Commit Graph

58 Commits

Author SHA1 Message Date
Windel Bouwman
589c431c8c Merge master branch 2019-08-15 18:59:29 +02:00
Dong-hee Na
4ea960c67b complex: Implement __getnewargs__ 2019-08-15 15:34:07 +09:00
Windel Bouwman
d06dec77ea Attempt to reduce the size of the pyobject.rs files by splitting out builtin types. 2019-08-14 19:08:47 +02:00
Dong-hee Na
d349d254f6 complex: Fix hash function to work correctly
Currently, hash(3.1-4.2j) or hash(3.1+4.2j) is crashed due to
overflow error on RustPython.

This patch will fix this issue.
2019-07-10 09:21:19 +09:00
Dong-hee Na
b1aa10d03e Fix complex representation for negative imaginary number case. 2019-06-29 16:30:34 +09:00
Maxim Kurnikov
bc35a64e54 fix most of clippy warnings 2019-06-01 03:19:22 +03:00
Jeong YunWon
87fc4cc470 Add complex.__hash__ 2019-05-16 06:21:33 +09:00
Jeong YunWon
88e64adc56 Add complex __pow__ and __rpow__ 2019-05-04 01:05:27 +09:00
Jeong YunWon
930c8eef50 Add complex.{__mod__, __rmod__, __divmod__, __rdivmod__} 2019-05-04 01:05:27 +09:00
Jeong YunWon
9523baf5ac complex [r]truediv, [r]floordiv 2019-05-04 01:05:27 +09:00
Jeong YunWon
2a2d0e4764 Add complex.__rmul__ 2019-05-04 01:05:27 +09:00
Jeong YunWon
982bbd69d8 complex.__bool__ uses Zero::is_zero instead of zero() 2019-05-04 01:05:27 +09:00
Jeong YunWon
61de5f2efc complex.__eq__ using try_float 2019-05-04 01:05:27 +09:00
Jeong YunWon
9a7fadcb6c Refactor PyComplex using try_complex 2019-05-04 00:59:19 +09:00
Jeong YunWon
7b438d9be8 impl IntoPyObject for Complex64 2019-05-04 00:59:19 +09:00
Jeong YunWon
9448254914 PyComplex uses extend_class for __new__ and __doc__ 2019-05-04 00:59:19 +09:00
Nicolas Trinquier
490db0a84f Add support for complex type for the to_complex function 2019-04-29 20:13:01 +02:00
Nicolas Trinquier
eebdbfe679 Add int and float methods for the complex type 2019-04-29 18:39:10 +02:00
Nicolas Trinquier
f8373aa38a Add mul method for the complex type 2019-04-29 18:34:35 +02:00
Jeong YunWon
dc05459459 Add float.__sub__, float.__rsub__ 2019-04-28 12:20:45 +09:00
Jeong YunWon
a2625916f5 Fix complex.__add__ to support float 2019-04-28 12:01:54 +09:00
Jeong YunWon
2eae737f3d complex.__add__ can raises OverflowError 2019-04-28 06:52:54 +09:00
Jeong YunWon
15e4e678ca Add complex.__bool__ 2019-04-28 06:19:12 +09:00
Jeong YunWon
ed79ccc6b1 PyComplex uses PyClassImpl 2019-04-28 06:04:21 +09:00
Joey
6863c19fb7 complex: convert to new args style 2019-04-02 09:51:06 -07:00
Joey
75d02a1725 complex: move to impl block 2019-04-02 09:30:18 -07:00
Adam
26a238085f Merge pull request #724 from RustPython/cleaning-tweaks
Increase usage of extend_class macro.
2019-03-23 09:14:50 +00:00
Windel Bouwman
b93f96d491 Increase usage of extend_class macro. 2019-03-23 09:16:32 +01:00
ben
c1d5ce715f Change isinstance/issubclass to accept PyClassRef instead of PyCObject.
Also changed PyValue::class to return a PyClassRef.
2019-03-23 19:32:31 +13:00
ben
5c7812734d Use more specific ref type than PyObjectRef in PyContext 2019-03-23 13:00:12 +13:00
coolreader18
a9051ab462 Convert all &mut VirtualMachine to &VirtualMachine 2019-03-22 01:48:14 -05:00
Joey
9de7285d23 Merge remote-tracking branch 'origin/master' into joey/pyobject-function-split
Conflicts:
      vm/src/frame.rs
      vm/src/obj/objbytearray.rs
      vm/src/obj/objbytes.rs
      vm/src/obj/objcomplex.rs
2019-03-16 08:37:18 -07:00
Joey
7bfd2e6e84 Move function items out of pyobject module 2019-03-15 21:27:11 -07:00
Adam
0e6e8b617d Merge branch 'master' into prefer_pyvalue_into_ref 2019-03-15 22:11:51 +00:00
Adam Kelly
e8e8544b4b Avoid use of PyObject in objcomplex. 2019-03-15 16:09:04 +00:00
Joey
fa9e48a5b3 Take &mut VirtualMachine insteadof &PyContext 2019-03-14 21:43:19 -07:00
Joey
737ec12fa5 Rename PyValue::{required_type => class} 2019-03-14 20:08:41 -07:00
Joey Hain
053ceb1a30 Move payload boxing into PyObject::new 2019-03-10 20:19:28 -07:00
Joey Hain
5971fc3bd4 rename PyObjectPayload2 to PyValue 2019-03-10 13:48:51 -07:00
Joey Hain
e2e13af7ea Remove PyObjectPayload 2019-03-10 13:45:38 -07:00
Joey Hain
f820aeb1ea Convert complex payload 2019-03-04 09:04:24 -08:00
coolreader18
f364ea5943 Fix a bunch of clippy lints 2019-03-01 18:41:45 -06:00
Joey Hain
f10fa6db44 Remove outer RefCell from PyObjectRef 2019-02-25 21:01:37 -08:00
Adam Gutglick
f333c75fd6 Added the ability to do addition between complex numbers and ints. 2019-02-22 08:42:44 -05:00
Adam Gutglick
38b4c10833 Added the ability to do addition between complex numbers and ints. 2019-02-21 19:28:46 -05:00
Joey
df76ffe116 Replace most relative imports with 2018-style crate 2019-02-20 08:50:53 -08:00
janczer
2a2ddff14e Add complex methods real and imag 2019-02-14 16:56:32 +01:00
Joey Hain
520f71f354 Add NotImplemented built-in constant 2019-02-08 19:24:08 -08:00
Joey Hain
d66ca54a2d Add complex.{__eq__, __neg__} 2019-02-08 18:20:58 -08:00
Joey Hain
fc863aaba5 Add complex.__abs__ 2019-02-08 18:20:55 -08:00