10 Commits
Author SHA1 Message Date
youknowdotandyouknowdot c70e9b8443 Sync selected Python 3.15 core library tests and repr type errors (#9321)
* Sync Python 3.15 core library tests and repr type errors

Synchronize ten selected library paths from CPython 3.15.0 at
d220409a13b77de7a6c30abe16ea90db01528edc using the canonical updater,
retaining existing RustPython adapters and failure markers.

Match generic __repr__ invalid-result errors to the qualified type-name
format required by the canonical ExceptionGroup regression, preserving
string results and exceptions raised by the implementation.

Implementation, source review, and validation were AI-assisted. The model
version identifier is unavailable; automated checks are not human
verification. Bounded validation covers 43 passes and one canonical skip,
not the full repository suites.

Assisted-by: OpenAI Codex:model version unavailable

* Preserve original escape decoder consumed length after callbacks

Keep the original input length as consumed after successful unicode-escape
and raw-unicode-escape decoding, including error-handler input replacement.
Only report the current cursor when a non-final decode stops on incomplete
input, matching CPython's codec wrappers and incomplete exits.

Fix the canonical Unicode escape mutation regression that failed CI on
Linux, macOS and Windows. Preserve all Lib tests and existing assertions.
Bounded Linux validation: 55 passes and one canonical skip, CLI build and
strict common/VM Clippy passed. Full repository suites were not run.

Implementation, source review, and validation were AI-assisted. The model
version identifier is unavailable; automated checks are not human
verification.

Assisted-by: OpenAI Codex:model version unavailable

---------

Co-authored-by: youknowdot <336763669+youknowdot@users.noreply.github.com>
2026-10-23 18:01:14 +09:00
Changjoon e7252b2c4e Make mappingproxy's nb_or slot symmetric for dict | mp (#7723)
* Make mappingproxy's nb_or slot symmetric for dict | mp

CPython's mappingproxy_or (Objects/descrobject.c) unwraps a mappingproxy
on either side of '|' to its underlying mapping and delegates back to
PyNumber_Or. This makes 'dict | mp', 'mp | dict', and 'mp | mp' all
produce a plain dict result without dict's own nb_or having to know
about mappingproxy.

RustPython's 'or' slot in 'AsNumber for PyMappingProxy' only handled
the case where the left operand is a mappingproxy. When the slot fired
with a=dict, b=mp (because dict.nb_or returned NotImplemented), it
returned NotImplemented again — so 'dict | mp' raised TypeError. This
propagated to 'UserDict | mappingproxy' (which calls self.data | other).

Rewrite the slot to unwrap a mappingproxy on either side (or both)
before delegating to vm._or on the underlying mappings. The
inplace_or slot is unchanged — '|=' is still rejected.

Unmasks test_userdict.UserDictTest.test_mixed_or.

* Unmask test_types.MappingProxyTests.test_union

The slot fix in this PR also enables this test, which was marked
expectedFailure for the same dict|mappingproxy TypeError. Caught as
UNEXPECTED SUCCESS in CI.
2026-04-29 18:16:27 +09:00
Shahar Naveh 30323d5a52 Update seq tests from 3.14.4 (#7606)
* Update seq related tests
2026-04-15 14:17:01 +09:00
ShaharNaveh ab9594c4de Update test_dictcomps, test_userdict 2026-02-13 13:36:33 +02:00
ShaharNaveh e00a95d15c Update test_userdict.py from 3.13.7 2025-08-31 12:14:40 +03:00
LYK 58f988bf33 Update test_userdict.py from CPython 3.11.2
Only whitespace is different.
2023-03-08 14:37:00 +09:00
Jeong YunWon 743ca30a46 remove windows stack overflow skipIf 2022-07-25 03:29:06 +09:00
CPython developers c62076e0e9 Update test_dict from CPython 3.10.5 2022-07-18 03:54:49 +09:00
Padraic Fanning 9c5343b9ae Skip stack overflow on Windows 2021-06-09 19:31:15 -04:00
Padraic Fanning ae00fef135 Add test_userdict from CPython 3.8 2021-06-09 17:47:35 -04:00