161 Commits

Author SHA1 Message Date
Noa
6daee1b00e Warn on elided_lifetimes_in_paths 2025-03-01 13:49:33 +09:00
Ashwin Naren
b870b0e1b5 2024 edition formatting
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-02-26 11:48:22 -08:00
Noa
b7db23bbae Fix warnings for Rust 1.84 2025-01-11 18:48:27 +09:00
Noa
fbd0c7a99e Implement IncrementalNewlineDecoder in rust 2024-11-14 23:06:53 -06:00
Jeong YunWon
1f62190eef Use Sequence protocol for in operation 2024-05-07 21:33:14 +09:00
Jeong YunWon
52aad1ec08 DefaultConstructor impls Constructor; Unconstructible is not anymore 2024-05-06 00:54:39 +09:00
Jeong, YunWon
1c93c1630b Merge pull request #5164 from dchiquito/frozenset-hash
Use CPython hash algorithm for frozenset
2024-02-10 14:55:24 +09:00
Ikko Eltociear Ashimine
61e40de32b Fix typo in slot.rs (#5162)
overriden -> overridden
2024-02-10 11:43:40 +09:00
Daniel Chiquito
bf461cdebc Use CPython hash algorithm for frozenset
The original hash algorithm just XOR'd all the hashes of the elements of
the set, which is problematic. The CPython algorithm is required to pass
the tests.

- Replace `PyFrozenSet::hash` with CPython's algorithm
- Remove unused `hash_iter_unorded` functions
- Add `frozenset` benchmark
- Enable tests
- Lower performance expectations on effectiveness test
- Adjust `slot::hash_wrapper` so that it doesn't rehash the computed
  hash value in the process of converting PyInt to PyHash.
2024-02-09 21:02:40 -05:00
Jeong YunWon
dc569e9921 Refactoring 2023-05-10 19:35:27 +09:00
Jeong YunWon
e73603945d Rename PyTypeFlags::METHOD_{DESCR => DESCRIPTOR} 2023-04-30 17:45:05 +09:00
Jeong YunWon
98eef0804e Method overhaul with PyMethodDef 2023-04-30 17:33:23 +09:00
Jeong YunWon
9f58921a6f Rename IterNextIterable -> SelfIter by following CPython 2023-04-30 03:54:32 +09:00
Jeong YunWon
9b9dd1100a Add missing with(Iterable) 2023-04-30 03:54:32 +09:00
Jeong YunWon
2abf21b134 PyObject_SelfIter 2023-04-30 00:17:36 +09:00
Jeong YunWon
30b8d7bdad MemberDescrObject -> PyMemberDescriptor 2023-04-25 04:54:51 +09:00
Jeong YunWon
f256934f93 Merge define_exception into pyexception 2023-04-24 02:06:13 +09:00
Jeong YunWon
a4a6e8dabe Fix trivial suggestions 2023-04-19 22:18:19 +09:00
snowapril
9f28643ac7 Fix inplace_power in number slots
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril
3a9a1c93dd Fix cargo formatting
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril
3613edf321 Fix unary function to take PyNumber
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril
05900fbabf Fix power, inplace_power as ternary function
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
snowapril
51ae26128b Modify unary functions in number protocol
Signed-off-by: snowapril <sinjihng@gmail.com>
2023-04-19 22:18:19 +09:00
Jeong, YunWon
92b1a5bf3e Merge pull request #4740 from youknowone/method-pyobject2
method calls to take &PyObject
2023-03-24 15:36:37 +09:00
Kangzhi Shi
e22ff3af36 improve Comparable take zelf as reference 2023-03-23 21:37:28 +02:00
Jeong YunWon
494c7bda58 method calls to take &PyObject 2023-03-22 22:09:14 +09:00
Kangzhi Shi
c5ce44eaaa remove slots.as_number replaced with slots.number 2023-03-21 22:48:56 +02:00
Kangzhi Shi
75e11daa95 fix right_op_wrapper 2023-03-21 22:32:27 +02:00
Kangzhi Shi
0a8c642e93 change as_number to static immutable 2023-03-21 21:51:45 +02:00
Kangzhi Shi
6a45c3e25a move PyNumberSlots into protocol/number.rs 2023-03-21 21:32:16 +02:00
Kangzhi Shi
d6acd2ee7d refactor PyNumberBinaryFunc 2023-03-21 21:27:51 +02:00
Jeong YunWon
73364fa2db try &'static str for slots.name 2023-03-20 20:15:56 +09:00
Jeong YunWon
dfb37d9a44 setattro uses Py<PyStr> 2023-03-20 19:00:02 +09:00
Jeong YunWon
ab1de2942c type.__name__ & getattr optimization 2023-03-20 19:00:01 +09:00
Jeong YunWon
ad29fbdd55 apply early returning pattern 2023-03-18 21:51:07 +09:00
Jeong YunWon
8851a246de Simplify Representable impls 2023-03-18 20:42:12 +09:00
Charles Hubain
23cfdfffba Implemented repr slot 2023-03-18 19:28:05 +09:00
Jeong YunWon
310a83427c cspell derive 2023-03-16 22:42:03 +09:00
Jeong YunWon
3c4ac0e5a2 clean up PyNumber interfaces 2023-03-10 01:37:30 +09:00
Jeong YunWon
9822749c92 PyNumberBinaryOpSlot -> PyNumberBinaryOp
it is not a slot
2023-03-10 01:17:44 +09:00
Zhiyan Xiao
984db6798c Add PyNumberSlots to support right binary ops 2023-03-09 23:41:48 +09:00
Zhiyan Xiao
ba9c354e1b Add binary ops in Number Protocol to update_slot 2023-03-09 21:33:25 +09:00
Jeong YunWon
5a74f08c84 Merge pull request #4654 from youknowone/pycallble
Add protocol object PyCallable
2023-03-08 05:01:31 +09:00
Jeong YunWon
f0a29de87d AsNumber::number_downcast_exact useful for actual numbers 2023-03-08 01:37:58 +09:00
Jeong YunWon
b60271a6cf deprecate vm.invoke 2023-03-08 01:35:30 +09:00
seungha-kim
223fe14d85 Update to pass test for unhashable collections (#4640) 2023-03-07 23:45:33 +09:00
Jeong YunWon
1848c45302 first cspell dict 2023-01-09 19:57:23 +09:00
Kangzhi Shi
f16a48df39 Refactor Number Protocol 2022-12-24 15:42:06 +09:00
Jeong YunWon
d935fbc445 Fix nightly clippy warnings 2022-12-05 12:18:16 +09:00
Jeong YunWon
38b169e863 Merge pull request #4217 from oow214/type_annotations
Add annotations for type
2022-10-22 15:50:22 +09:00