Commit Graph

131 Commits

Author SHA1 Message Date
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
Robert Berglund
81302ce6c2 impl __sizeof__ for bytearray, int, list, str, dict and set (#1426) 2019-10-16 23:24:36 +09:00
Jeong YunWon
6c0f852b62 Refactor pymethod return types to be smaller as possible 2019-10-11 03:27:23 +09:00
Timur Makarchuk
4b962b89d7 Implement some __ne__ methods (#1446)
* Implement some __ne__ methods

Added test snippets from `__ne__` methods

* Fix incompatability in str.__eq__ befaviour

Previously "".__eq__(1) returned "False", which is not the case in
cpython.
Not it's returning 'NotImplemented', as it should
2019-10-06 00:50:02 +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
Noah
00a0e455f3 Merge pull request #1387 from RustPython/coolreader18/string-hash-field
Add a hash field to PyString á la CPython, make PyString.value private
2019-09-21 17:15:17 -05:00
Noah
0def37d78e Make PyString.value private 2019-09-19 17:45:48 -05:00
Noah
dfeeda1c4c Match an actual match expression in match_class! 2019-09-19 18:27:34 +00: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
coolreader18
9204035d97 Cover up bare trait objects with a dyn 2019-07-10 09:41:58 -05:00
Maxim Kurnikov
848714e18e save passed object into the first .args parameter for dict/mappingproxy KeyError 2019-06-26 23:40:24 +03:00
Jeong YunWon
c349f77207 Add {set,frozenset}.__r*__ 2019-05-29 21:51:20 +09:00
Jeong YunWon
ba4ac902eb PySet/PyFrozenSet doesn't call PyObject::new 2019-05-29 21:51:20 +09:00
Jeong YunWon
979e1253ae Fix set/frozenset comparison 2019-05-29 21:51:20 +09:00
Jeong YunWon
31c88721e6 Refactor PySet with try_set_inner! 2019-05-29 21:51:20 +09:00
Jeong YunWon
89729c3155 PyClassImpl for PySet, PyFrozenSet 2019-05-29 21:51:20 +09:00
Jeong YunWon
81186ea5b7 Fix set() hash collision based on dictdatatype::Dict 2019-05-16 00:02:39 +09:00
Adam
2c747168de Merge pull request #926 from youknowone/number-hashes
Fix number hashes for small numbers
2019-05-13 09:02:19 +01:00
Jeong YunWon
64afd5ccf8 Add os.supports_* placeholders 2019-05-13 01:15:19 +09:00
Jeong YunWon
c768b25673 Refine hash types and refactor hash impl 2019-05-13 01:10:52 +09:00
Aviv Palivoda
3986e2f87d Add set.isdisjoint 2019-04-21 16:41:36 +03:00
ben
6650ad895a Fix a bunch of clippy warnings 2019-04-14 10:07:50 +12:00
Aviv Palivoda
abc72e9992 contains return bool 2019-04-07 23:54:42 +03:00
Aviv Palivoda
5ae921dc57 update function support iterable 2019-04-07 23:26:59 +03:00
Aviv Palivoda
848350d334 ior support only set and frozenset 2019-04-07 23:06:42 +03:00
Aviv Palivoda
3ed8727ee5 symmetric_difference support iterable 2019-04-07 23:01:49 +03:00
Aviv Palivoda
e011e3f327 intersection and difference support iterable 2019-04-07 22:36:56 +03:00
Aviv Palivoda
fa369ff779 Limit non-operator versions to set and frozenset 2019-04-07 22:09:37 +03:00
Aviv Palivoda
3bc1e3598c Use PyIterable 2019-04-07 21:26:20 +03:00
Aviv Palivoda
a0aa88d2fb clear return implicit None 2019-04-07 20:02:27 +03:00
Aviv Palivoda
2a3a88c2f2 Use match_class macro to avoid unwanted clones 2019-04-05 19:59:01 +03:00
Aviv Palivoda
a685216f29 Use new arg style for set and frozenset new 2019-04-05 19:59:01 +03:00
Aviv Palivoda
ed8c1e1a95 Implement set and frozenset with PySetInner 2019-04-05 19:58:17 +03:00
ben
ea872521d6 Make object by default hashable 2019-04-04 20:11:53 +13:00
Adrian Wielgosik
c918e9d5d3 Split iterators into separate types 2019-04-01 19:45:14 +02:00
Adrian Wielgosik
bbfca26b27 Move PyIteratorValue to objiter.rs 2019-04-01 19:45:10 +02:00
Joey Hain
cc4f3fdb40 Clean up TypeProtocol 2019-03-25 19:18:01 -07:00
Adam Kelly
17b816fbf8 Fix objset compilation error caused by merge race. 2019-03-25 20:37:47 +00:00
Windel Bouwman
6ae10ed938 Fix build and add extend_class macro usage for set and frozenset 2019-03-25 20:23:13 +01:00
Aviv Palivoda
590b659548 Change validate_set_or_frozenset to a function 2019-03-23 23:24:57 +02:00
Aviv Palivoda
dc05d5f94b Remove Refcell around PyFrozenSet elements 2019-03-23 17:28:50 +02:00
Aviv Palivoda
2626a800ab Support frozenset 2019-03-23 17:27:33 +02: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
Adam Kelly
c6e7d8901f Remove use of PyObject::new from objset. 2019-03-19 17:14:51 +00:00