Commit Graph

68 Commits

Author SHA1 Message Date
Do Nhat Minh
914454e4ba Add __pos__ to PyComplex 2020-02-10 11:23:50 -05:00
Jeong YunWon
6ddb690e09 Remove _vm parameter when it is not required 2020-02-06 11:07:51 +09:00
Jeong YunWon
1bac582921 &str::to_string -> &str::to_owned for literals 2020-02-05 22:55:33 +09:00
Jeong YunWon
7fd92fcc71 Py_TPFLAGS_BASETYPE 2020-01-30 16:32:09 +09:00
Jeong YunWon
8c7e01b4f6 pyslot guess slot name from function name 2020-01-15 10:28:39 +09:00
Jeong YunWon
cbbacbaa47 Refactor PyComplex 2019-12-26 22:17:29 +09:00
Jeong YunWon
6c0f852b62 Refactor pymethod return types to be smaller as possible 2019-10-11 03:27:23 +09:00
Noah
d22cac2dd8 Rename new slots to tp_new 2019-09-29 23:14:37 -05:00
coolreader18
c46b5b50bd Fix weirdness with type.__new__()/type()/metaclass.__new__() 2019-09-29 23:14:31 -05:00
Aviv Palivoda
a5026eded0 Use IntoPyFloat in complex 2019-09-14 12:55:22 +03:00
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