41 Commits

Author SHA1 Message Date
Shahar Naveh
3ed8c91fef Update test/support to 3.14.5 (#7896)
* Update `test/support` to 3.14.5

* Adjuat test markers

* Add `test_set` to env polluting tests
2026-05-18 00:23:06 +09:00
Shahar Naveh
c98939a7c1 Update seq tests from 3.14.4 (#7606)
* Update seq related tests
2026-04-15 14:17:01 +09:00
Shahar Naveh
5a56a76fad Update test_set.py from 3.14.3 (#7282)
* Update `test_set.py` from 3.14.3

* Cleanup code a bit

* Mark failing tests
2026-03-01 10:58:23 +09:00
Lee Dogeon
8589b55203 Avoid set changed size during iteration (#5860) 2025-06-29 02:14:22 +09:00
Ankit Goel
48025e0102 Cache hash value for FrozenSets
Adds a hash field to the `PyFrozenSet` data type in order to avoid
recomputing the hash of an immutable object.
2024-09-22 06:15:54 +01:00
Daniel Chiquito
074d228a7a Use correct TODO syntax
Co-authored-by: fanninpm <luxverdans@sbcglobal.net>
2024-02-09 21:41:45 -05: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
Taegi Song
e782c21e96 Fix test_merge_and_mutate 2022-07-24 15:50:21 +09:00
Jeong Yunwon
da54c40566 adjust failing markers for test_set 2022-07-18 03:54:49 +09:00
CPython developers
71c2772d9e Update test_set from CPython 3.10.5 2022-07-18 03:54:49 +09:00
CHOUMnote
fabcfa60ab fix test_weakref 2022-05-21 20:17:13 +09:00
Dean Li
29c953d9a6 test: update test.support and test_io to 3.10
Initially this is only meant to be a small update for `test_io.py`.
But it turns out that `test.support` need a lot of cleanup especially
for `test.support.warnings_helper`.
2022-04-18 22:50:55 +08:00
Dean Li
5ee4fb899b test: use os_helper 2021-11-28 20:51:32 +08:00
Jeong YunWon
913b78ca44 Revert "Merge pull request #3433 from deantvv/test-update"
This reverts commit 9fa5c5ac66, reversing
changes made to e7fa32c687.
2021-11-17 17:06:51 +09:00
Dean Li
49a5805d11 test: use os_helper 2021-11-13 02:18:33 +00:00
Alex Muscar
cd4216097f fix: __repr__ use collection subclass name
Addresses: https://github.com/RustPython/RustPython/issues/3217

This patch changes the `set`, `frozenset`, `deque` and `bytearray`
collections to use the subclass name in `__repr__`, if they are
subclassed.
2021-10-06 10:01:36 +01:00
jfh
049e9bd41d Add __reduce__ for set iterator. 2021-08-30 19:53:48 +03:00
Snowapril
7cc2a5431f Fix frozenset copy to return self (#2883)
Fix frozenset copy to return zelf if called on frozenset instance
2021-08-14 15:56:22 +03:00
jfh
ac0d5ff8b0 Add reduce for set, frozenset. 2021-08-14 01:11:13 +03:00
jfh
4a460248b9 Retrying contains, remove, discard with a frozenset. 2021-08-13 17:33:13 +03:00
jfh
6950ad6ee4 Initialize with init for mutable builtins. 2021-08-04 20:57:47 +03:00
jfh
fdc08139a5 Make empty frozenset a singleton. 2021-06-17 17:30:51 +03:00
Padraic Fanning
d0565d5a8f Unskip tests in test_set 2021-02-25 23:02:34 -05:00
Padraic Fanning
e5b0937b60 Unskip TestGraphs 2021-02-07 16:35:15 -05:00
Padraic Fanning
3e5ea14e9f Explain test_deep_copy skip 2021-02-07 16:34:08 -05:00
Padraic Fanning
911eaa489d Explain test_free_after_iterating skip 2021-02-07 16:30:53 -05:00
Padraic Fanning
749b4b5082 Explain test_container_iterator skip 2021-02-07 16:30:01 -05:00
Padraic Fanning
ebebe1766c Explain test_cyclical_repr skip 2021-02-07 16:28:50 -05:00
Padraic Fanning
2a462da084 Unskip test_gc 2021-02-07 16:26:27 -05:00
Padraic Fanning
08d58a5eeb Explain test_iterator_pickling skip 2021-02-07 16:23:00 -05:00
Padraic Fanning
c103ceb949 Explain test_pickling skip 2021-02-07 16:21:47 -05:00
Padraic Fanning
9edac89f17 Explain test_contains skip 2021-02-07 16:19:51 -05:00
carbotaniuman
6484df327e Make frozenset idempotent and unskip some set tests 2020-11-21 14:57:10 -06:00
Jeong YunWon
950ae441f3 unskip test_set.py 2020-11-12 11:30:33 +09:00
Jeong YunWon
baf70d95a8 Unmark test_set skips 2020-08-18 18:13:33 +09:00
hatee-hatee-hatee-ho
4903f8e5ab Implemented SetIterator
skip test TestWeirdBugs.test_merge_and_mutate

Co-Authored-By: Daniel Alley <dalley@redhat.com>
2020-08-09 16:24:38 +09:00
Aviv Palivoda
3db197c4b1 Fix set intersection_update 2020-02-22 12:59:48 +02:00
Aviv Palivoda
84250294b0 Fix frozenset hash 2020-02-22 12:36:27 +02:00
Aviv Palivoda
be9d8a4a56 Fix symmetric_difference 2020-02-22 11:22:01 +02:00
Aviv Palivoda
fb7a2ce686 Mark unsupported tests 2020-02-21 11:12:50 +02:00
Aviv Palivoda
9ba7e6e691 Add test_set from CPython 3.8 2020-02-16 20:32:50 +02:00