20 Commits

Author SHA1 Message Date
Daniel Chiquito
9481df23e1 Disable test_Buffer
This test will not work until the `__buffer__` and `__release_buffer__`
methods are implemented on the appropriate builtin types, which is
outside the current scope.
2024-02-24 11:02:41 -05:00
Daniel Chiquito
0bd8c2504c Update test_collections.py to 3.12.2 2024-02-23 20:16:16 -05: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
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
Daniel Chiquito
ffc52ef87c Removed unused __bool__ methods
Python does not define `list().__bool__`, `dict().__bool__`, and
`str().__bool__`, and some tests were failing because they were
defined.
I could not find any references to them and deleting them doesn't
seem to break anything.
2024-02-09 20:58:17 -05:00
Bobby Palmer
500b0024f0 updated _collections_abc.py and test_collections.py to CPython 3.11.2 (#5016)
* updated _collections_abc.py and its tests in test_collections.py

* decorated failing tests in test_typing.py
2023-06-18 17:31:03 +03:00
Zhiyan Xiao
a949c35228 Temp: Skip test_collections.TestChainMap.test_union_operators 2023-03-09 23:51:14 +09:00
seungha-kim
223fe14d85 Update to pass test for unhashable collections (#4640) 2023-03-07 23:45:33 +09:00
Jeong Yunwon
7580e11320 adjust failing markers for test_{collections,defaultdict} 2022-07-18 03:54:49 +09:00
CPython developers
9537149572 Update collections/test_{collections,defaultdict} from CPython 3.10.5 2022-07-18 03:54:49 +09:00
Jeong YunWon
8484a91ed3 Fix reflection operator priority for subtypes 2022-04-14 02:38:54 +09:00
Chris Moradi
ab58885734 Check that all abstract methods are implemented prior to instantiation 2021-11-13 17:09:26 -08:00
joohongpark
5ceb2be86e fixed set.{__ror__, __sub__} operator to behave according to type 2021-11-11 16:11:48 +09:00
Chris Moradi
ec247e0d4f Update collections from CPython, fix tests for UserDict/List/String
Clean implementation of changes in PR #3371 based on feedback.

Copies from [CPython tag `v3.9.7` and adds back custom RustPython changes where needed for:
- `Lib/collections/__init__.py`
- `Lib/test/test_collections.py`

Closes: #3371
2021-10-25 21:19:44 -07:00
Jim Fasarakis-Hilliard
e34198fc00 Remove HEAPTYPE flag from builtins. 2021-09-17 03:30:21 +09:00
fermian
b1207ab39e Update test_collections.py 2021-08-14 17:27:43 +09:00
Padraic Fanning
f8d184b5df Pass test_Sequence_mixins 2021-02-25 16:59:28 -05:00
Padraic Fanning
f48bc88d9b Bypass doctests for collections module 2021-02-15 20:08:41 -05:00
Padraic Fanning
83971376c1 Mark failing/erroring tests 2021-02-15 19:37:17 -05:00
Padraic Fanning
e92ef7f3f0 Add test_collections from CPython 3.8.7 2021-02-15 19:22:03 -05:00