25 Commits
Author SHA1 Message Date
28393e932d Implement PEP 814 frozendict (#8951)
* Restore consolidated frozendict implementation on current main

Preserve reverse dictionary iterator fixes and the 3.15 frame imports. Keep library refreshes separate pending the runtime dependency sequencing decision.

Assisted-by: OpenAI Codex:model identifier unavailable

* Support scoped canonical test updates in update_lib

Index conditional test classes and methods without crossing namespaces, reject ambiguous targets, and preserve inherited override indentation. Add hash-pinned whole-test copying that verifies execution context and exact source bytes, with focused Python fixtures.

Assisted-by: OpenAI Codex:model identifier unavailable

* Align frozendict copy support and tests with CPython 3.15

Import exact-final copy.py with update_lib; defer Mapping ABC registration to the later library stage. Generate only proven marker corrections, retain observed debug recursion-limit expected failures, and copy the complete canonical builtin-doc discovery test using hash-pinned update_lib copy-test.

Assisted-by: OpenAI Codex:model identifier unavailable

* Preserve decorator rationale during canonical test copying

Reject differing decorator source blocks even when their ASTs match. Cover inline and multiline marker comments, guarded async methods, and CLI no-write behavior.

Assisted-by: OpenAI Codex:model identifier unavailable

* Finish frozendict with borrowed PyAnyDict views

Use the landed PyRef target model for a transparent dict/frozendict header
view, retaining objects explicitly with PyRef<PyAnyDict>. Keep targets
sealed and preserve mutable-only entry points. Borrow frame globals from
the object header rather than movable reference wrappers.

Unify exact-TypeError key diagnostics with final CPython semantics,
including callback failure propagation and no explicit cause. Keep the
Python regressions in builtin_dict and test reference layout/ownership
in Rust. Preserve existing canonical library updates.

Assisted-by: OpenAI Codex:model identifier unavailable

* Align frozendict with CPython and use CPython 3.15 tests

- Name the target type in unhashable key errors through
  PyDict::update_arg (dict_update_arg), replacing the separate
  PyFrozenDict::merge_into copy of the merge logic.
- Split the | operator into dict_or (_PyDict_Or) and frozendict_or.
- Return the argument from frozendict(frozendict) only when the called
  type is frozendict.
- Call through the vectorcall slot in PyCallable::invoke when there
  are no keyword arguments, instead of special-casing frozendict.
- Add ensure_builtins (_PyEval_EnsureBuiltins) for eval/exec, and
  insert __builtins__ for source strings regardless of globals type.
- Read __warningregistry__ and __name__ from stored globals entries and
  accept only None or str for the module name in setup_context.
- Remove the unused PyFrozenDict::from_object.
- Migrate test_dict.py, mapping_tests.py, test_copy.py and
  test_builtin.py to v3.15.0 with update_lib, and add
  test_import/data/syntax_warnings.py.
- Drop builtin_dict.py frozendict tests covered by those modules,
  keeping the descriptor and namespace integration tests.

Assisted-by: Claude Code:claude-opus-5-5

* Update crates/vm/src/builtins/dict.rs

---------

Co-authored-by: Jeong YunWon <jeong@youknowone.org>
Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2026-10-14 16:42:56 +09:00
Shahar Naveh a6d88b144e Update some libs and tests to 3.14.7 (#8593)
* test_weakref

* test_inspect

* socket

* test_copy

* pickle

* test_ast

* string

* zstd

* test_py_compile

* test_os

* mark failing test

* mark failing

* fix markers
2026-08-25 22:01:24 +09:00
Copilot 725ffafd13 Update copy module and test_copy from CPython v3.14.3 (#7062) 2026-02-10 00:05:15 +09:00
Jeong, YunWon 242c8ea0c3 generator is borrowed 2026-02-02 00:43:07 +09:00
Jeong, YunWon 309af4dc5b mark test failures
Assisted-by: Codex:gpt-6
2026-02-02 00:43:07 +09:00
Lee Dogeon 3bcd071e4d Bump collections to 3.14.2 (#6770)
* Bump collections to 3.14.2

* Unmark resolved tests
2026-01-20 23:58:43 +09:00
Jeong, YunWon 02cc257b42 Support pickle better with __getnewargs_ex__ (#6749)
* Implement pickle more

* add weakref check

* check exports in __setstate__

* remove reducelib
2026-01-17 18:37:16 +09:00
Jeong, YunWon d11604995a Upgrade dataclasses from CPython 3.13.10 2025-12-12 21:43:57 +09:00
Shahar Naveh c195473a29 Update copy from 3.13.5 (#5913) 2025-07-08 23:49:57 +09:00
Blues-star 83b8c3a3fc Update test_copy.py from CPython v3.12.0 2024-02-20 19:38:58 +08:00
carlosmiei 4d05077ec3 Update test_copy.py from CPython 3.11 2023-03-09 10:59:44 +00:00
Daeun Lee d29f5d738c Update test_copy.py from CPython v3.10.5 2022-07-27 14:42:44 +09:00
Noa f9d9a1e15e Implement weakref._remove_dead_weakref 2021-11-15 16:08:47 -06:00
Noa e51cb82ff0 Unskip tests 2021-11-15 16:08:46 -06:00
jfh 54a5db29ae Handle recursions when comparing objects. 2021-10-14 10:13:25 +03:00
Jeong YunWon a4c65049bf Fix int/float enum pickle (#2945)
Add {int,float}.__getnewargs__
2021-08-24 06:33:55 +03:00
Noah 6f0013a3a8 Add method.__self__ attribute 2021-06-02 21:17:15 -05:00
Noah 3c3801bbe4 Improve defaultdict some more 2021-04-11 17:38:44 -05:00
Noah 3f36dcdaef Merge pull request #2426 from RustPython/fix-utime
Fix os.utime to be able to take floats
2021-02-11 10:16:35 -06:00
Noah f38d8af12b Fix __reduce_ex__ and unskip tests 2021-02-08 12:36:54 -06:00
Padraic Fanning b81c6ad483 Explain test_deepcopy_reflexive_dict skip 2021-02-07 15:49:41 -05:00
Padraic Fanning 12d4a665db Explain test_deepcopy_reflexive_tuple skip 2021-02-07 15:49:41 -05:00
Padraic Fanning dde4dfdd09 Explain test_deepcopy_reflexive_list skip 2021-02-07 15:49:41 -05:00
Jeong YunWon c8e5040d35 mark failing tests from test_copy.py 2020-01-31 18:12:18 +09:00
CPython developers cebca9e6d3 Add test_copy.py from CPython v3.8.1 2020-01-31 17:55:59 +09:00