Skip to content

Align mapping collection and call unpacking with Python 3.15 - #9302

Merged
youknowone merged 2 commits into
RustPython:mainfrom
youknowdot:split/mapping-unpacking-315
Oct 22, 2026
Merged

youknowone merged 2 commits into
RustPython:mainfrom
youknowdot:split/mapping-unpacking-315

Conversation

@youknowdot

@youknowdot youknowdot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Split mapping collection, call-unpacking compatibility, and their canonical pickle-library dependency out of #8954, targeting CPython v3.15.0 (d220409a13b77de7a6c30abe16ea90db01528edc).

  • Return exact lists directly from mapping methods, preserve non-TypeError iterator exceptions, and share collection logic with dictionary merging.
  • Match Python 3.15 unpacking diagnostics and callback-error handling, while preserving the exact-dict stored-hash snapshot fast path.
  • Synchronize complete test_extcall, pickle, pickletools, picklecommon, pickletester, test_pickle, and test_pickletools modules through scripts/update_lib. Retain existing RustPython decorators and the existing DocTestChecker block through the updater's reviewed-block mechanism. No manual assertion edits or new skips.
  • Include the coherent pickle/pickletools library closure: bounded reads/frame handling, private-name fixtures, shared test contracts, themed disassembly and the in-process CLI.

CI exposed why these changes must travel together: the old pickletester.test_bad_newobj_ex_args still expected functools.partial() argument after ** ..., while final CPython's test and _PyEval_FormatKwargsError both use Value after ** .... The native diagnostic is retained; the complete canonical library dependency is synchronized instead of weakening the test or reverting the Python 3.15 behavior.

This is independent of #8944's ownership changes. No additional native changes were needed for the CI repair; the six pickle-related modules were regenerated and added as a dependent commit.

Validation

  • Normal repository commit hooks passed for both commits.
  • Fresh default+capi build, VM threading/non-default/compiler checks and strict all-target VM Clippy passed for native head 980defeed312058286e63883fd8fe0659d289416, on tested base 5927ce6e1a6ed00187723510b224514c0a779e57.
  • For the combined library commit, all 600 tracked native/Cargo source files were verified identical to that source-bound binary. No new native build or latest-main native execution is claimed.
  • Eleven selected canonical pickle/pickletools tests passed with the combined libraries, including the exact CI-failing PyPicklingErrorTests.test_bad_newobj_ex_args, private-method/nested-class tests on Python/native picklers, and disassembly/CLI tests. Zero skips, expected failures or unexpected successes. Whole isolated invocation: 4.64s, 153.4 MiB peak sampled process-group RSS.
  • Complete unchanged canonical test_extcall passed again with the combined libraries: six doctest suites and 194 source-bound examples. Separate isolated invocation: 4.09s, 133.7 MiB peak sampled process-group RSS.
  • Both combined-library invocations used 120s/1GiB limits, private temporary directories, actual import-origin checks and full pre/post source/binary hash verification.

The earlier 17-case differential and the initial pre-library test_extcall run remain historical evidence, not reruns on this combined tree. Full pickle/pickletools modules, oversized/malformed/sparse-memo and recursive cases, workspace/C-API aggregate suites and cross-platform integration remain unverified locally. Hosted CI must establish the combined change's integration status.

AI-assisted implementation, source comparison and validation using OpenAI Codex.

Preserve iterator exceptions and exact-list results when collecting mapping
methods, defer callable formatting, and retain exact-dict stored hashes.
Synchronize complete test_extcall with CPython v3.15.0.

Assisted-by: Codex:unknown
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 0b0a360 and 037a665.

⛔ Files ignored due to path filters: 7
  • Lib/pickle.py is excluded by !Lib/**
  • Lib/pickletools.py is excluded by !Lib/**
  • Lib/test/picklecommon.py is excluded by !Lib/**
  • Lib/test/pickletester.py is excluded by !Lib/**
  • Lib/test/test_extcall.py is excluded by !Lib/**
  • Lib/test/test_pickle.py is excluded by !Lib/**
  • Lib/test/test_pickletools.py is excluded by !Lib/**
📒 Files selected for processing: 3
  • crates/vm/src/builtins/dict.rs
  • crates/vm/src/frame.rs
  • crates/vm/src/protocol/mapping.rs
+-----------------------------------+
| Faking self-awareness since 2023. |
+-----------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

The following Lib/ modules were modified. Here are their dependencies:

[ ] test: cpython/Lib/test/test_cmd_line_script.py (TODO: 1)

dependencies:

dependent tests: (no tests depend on cmd_line_script)

[x] lib: cpython/Lib/pickle.py
[ ] lib: cpython/Lib/_compat_pickle.py
[x] test: cpython/Lib/test/picklecommon.py
[ ] test: cpython/Lib/test/test_pickle.py (TODO: 5)
[ ] test: cpython/Lib/test/test_picklebuffer.py (TODO: 1)
[ ] test: cpython/Lib/test/test_pickletools.py (TODO: 2)
[x] test: cpython/Lib/test/test_xpickle.py
[x] test: cpython/Lib/test/xpickle_worker.py

dependencies:

  • pickle (native: _pickle, itertools, sys)
    • _compat_pickle
    • _compat_pickle
    • io (native: _io, _thread, errno, msvcrt, sys)
    • argparse, codecs, copyreg, functools, pprint, struct, types

dependent tests: (98 tests)

  • pickle: test_annotationlib test_argparse test_array test_ast test_asyncio test_bool test_builtin test_bytes test_bz2 test_codecs test_collections test_concurrent_futures test_configparser test_coroutines test_csv test_ctypes test_decimal test_defaultdict test_deque test_descr test_dict test_dictviews test_email test_enum test_enumerate test_exceptions test_fractions test_functools test_generators test_genericalias test_genericpath test_http_cookies test_importlib test_inspect test_io test_ipaddress test_iter test_itertools test_json test_list test_logging test_lzma test_memoryview test_minidom test_opcache test_operator test_ordered_dict test_os test_pathlib test_pickle test_picklebuffer test_pickletools test_platform test_plistlib test_positional_only_arg test_random test_range test_re test_set test_shelve test_slice test_socket test_statistics test_str test_string test_structseq test_super test_time test_trace test_tuple test_turtle test_type_aliases test_type_params test_types test_typing test_unittest test_urlparse test_uuid test_xml_dom_minicompat test_xml_etree test_xpickle test_zipfile test_zlib test_zoneinfo
    • logging: test_asyncio test_concurrent_futures test_hashlib test_pkgutil test_support test_urllib2net
      • asyncio.futures: test_asyncio
      • http.cookiejar: test_http_cookiejar test_urllib2
      • multiprocessing.util: test_asyncio test_compileall test_concurrent_futures
      • venv: test_venv
    • tracemalloc: test_tracemalloc

[x] lib: cpython/Lib/pickletools.py
[ ] test: cpython/Lib/test/test_pickletools.py (TODO: 2)

dependencies:

  • pickletools

dependent tests: (1 tests)

  • pickletools: test_pickletools

[x] test: cpython/Lib/test/test_extcall.py

dependencies:

dependent tests: (no tests depend on extcall)

Legend:

  • [+] path exists in CPython
  • [x] up-to-date, [ ] outdated

Synchronize the six coherent serialization modules with CPython v3.15.0
through update_lib, retaining existing RustPython adaptations.

Assisted-by: Codex:unknown
@youknowone
youknowone marked this pull request as ready for review October 22, 2026 14:22
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T14:33:00.760478Z 037a665 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@youknowone
youknowone merged commit 6c171ff into RustPython:main Oct 22, 2026
20 of 21 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 037a665fb1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Lib/test/test_extcall.py
Traceback (most recent call last):
...
TypeError: test.test_extcall.g() argument after * must be an iterable, not Nothing
TypeError: Value after * must be an iterable, not Nothing

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Revert the forbidden expected-output edits

This rewrites a doctest expected result, and the commit does the same throughout the synchronized test files, but the repository's critical test policy explicitly forbids modifying assertions, logic, or data and limits test-file changes to expected-failure decorators. Leave the test body and expectation intact and use the permitted marker instead so the change follows the required test-modification workflow.

AGENTS.md reference: AGENTS.md:L276-L282

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants