Skip to content
Draft

gc #7

Changes from 1 commit
Commits
Show all changes
1268 commits
Select commit Hold shift + click to select a range
f2ef252
Update `random.py` to 3.14.5 (#7890)
ShaharNaveh May 17, 2026
8c98871
Update `http` to 3.14.5 (#7892)
ShaharNaveh May 17, 2026
5a5230a
Update `shutil.py` & `zipfile` to 3.14.5 (#7894)
ShaharNaveh May 17, 2026
b432d4c
Update `pickle.py` to 3.14.5 (#7895)
ShaharNaveh May 17, 2026
c77c56d
Update `venv` to 3.14.5 (#7897)
ShaharNaveh May 17, 2026
f4f0350
Update `test_rlcompleter.py` to 3.14.5 (#7898)
ShaharNaveh May 17, 2026
ab72b29
rustix/windows-sys for page size; drop maplit (#7876)
joshuamegnauth54 May 17, 2026
9c188b4
Update `ctypes` to 3.14.5 (#7899)
ShaharNaveh May 17, 2026
ea2a3d9
Build workspace cache (#7889)
ShaharNaveh May 17, 2026
a1a87dc
Add macro for type check functions in c-api (#7871)
bschoenmaeckers May 17, 2026
3ed8c91
Update `test/support` to 3.14.5 (#7896)
ShaharNaveh May 17, 2026
723766e
Don't skip passing ast tests (#7900)
ShaharNaveh May 17, 2026
883ce9d
Update `test_xpickle.py` to 3.14.5 (#7901)
ShaharNaveh May 17, 2026
a4579a9
Update NOP tests to 3.14.5 (#7902)
ShaharNaveh May 19, 2026
20cb884
Add unicode & bytes c-api support (#7904)
bschoenmaeckers May 19, 2026
6e56d93
Add integer c-api support (#7905)
bschoenmaeckers May 19, 2026
e16f1aa
Use correct dirs crate; drop uname for rustix (#7906)
joshuamegnauth54 May 19, 2026
67e66bd
code nits (#7908)
ShaharNaveh May 19, 2026
48ad238
Update some tests to 3.14.5 (#7909)
ShaharNaveh May 19, 2026
150b910
Fix "tried to pop from empty stack" with BlockExpr and const (#7916)
im-0 May 19, 2026
9c05578
Bump cargo-bins/cargo-binstall from 1.19.0 to 1.19.1 (#7917)
dependabot[bot] May 19, 2026
b902ffd
Bump github/gh-aw from 0.71.3 to 0.73.0 (#7918)
dependabot[bot] May 19, 2026
50f235a
Bump nix from 0.31.2 to 0.31.3 in the unix group across 1 directory (…
dependabot[bot] May 19, 2026
1fe4485
Bump siphasher from 1.0.2 to 1.0.3 (#7922)
dependabot[bot] May 19, 2026
5394129
Bump taiki-e/install-action from 2.76.0 to 2.77.6 (#7919)
dependabot[bot] May 19, 2026
e8d7437
Update `test_types.py` to 3.14.5 (#7912)
ShaharNaveh May 19, 2026
d8dee81
Bytecode parity (#7885)
youknowone May 19, 2026
276a0e6
Add tuple support to c-api (#7907)
bschoenmaeckers May 19, 2026
0a2461a
Update `test_grammar.py` to 3.14.5 (#7913)
ShaharNaveh May 19, 2026
c5143aa
Const eval all of version.rs (#7923)
joshuamegnauth54 May 19, 2026
ccf1508
Bump webpack-dev-server from 5.2.1 to 5.2.4 in /wasm/demo (#7924)
dependabot[bot] May 19, 2026
26f5bbf
Add type name c-api functions (#7925)
bschoenmaeckers May 19, 2026
62b081b
Resolve test_inspect bytecode parity gaps (#7926)
youknowone May 19, 2026
cea21f9
Add more c-api error functions (#7915)
bschoenmaeckers May 19, 2026
0063a6d
Align more error messages with CPython 3.14.5 (#7928)
ShaharNaveh May 19, 2026
d51069b
Align load-fast borrow barriers with CPython (#7930)
youknowone May 20, 2026
ae3804f
more hostenv isolation (#7886)
youknowone May 20, 2026
de06fc0
Add eval function to c-api (#7927)
bschoenmaeckers May 20, 2026
ee006af
Align more error messages with CPython 3.14.5 (#7933)
ShaharNaveh May 20, 2026
d073964
Remove unused binaries (#7936)
ShaharNaveh May 20, 2026
4daa526
Update `tzinfo` to 3.14.5 (#7934)
ShaharNaveh May 20, 2026
a6f13b9
Bump openssl from 0.10.79 to 0.10.80 (#7931)
dependabot[bot] May 20, 2026
ae6c160
Add call functions to c-api (#7937)
bschoenmaeckers May 20, 2026
948924a
Align cleanup bytecode layout with CPython (#7935)
youknowone May 20, 2026
a136f90
Add basic dict function to c-api (#7929)
bschoenmaeckers May 21, 2026
c845861
Add bool support to c-api (#7938)
bschoenmaeckers May 21, 2026
06f73f2
Align nested code object bytecode parity (#7942)
youknowone May 21, 2026
ab5bc43
Add float support to c-api (#7943)
bschoenmaeckers May 22, 2026
4eb9534
Add complex number support to c-api (#7945)
bschoenmaeckers May 22, 2026
2a16360
Rustls integration improvements (#7946)
im-0 May 22, 2026
cf3b639
Fix panic in select.select() when too many FDs specified (#7948)
im-0 May 22, 2026
c513b92
Update `test_socketserver.py` to 3.14.5 (#7949)
ShaharNaveh May 22, 2026
1a01393
Update `test_timeout.py` to 3.14.5 (#7950)
ShaharNaveh May 22, 2026
f3b83ef
Update `test_structseq.py` to 3.14.5 (#7951)
ShaharNaveh May 22, 2026
d3272e7
Align codegen metadata with CPython (#7952)
youknowone May 23, 2026
b9efe10
Add missing test for select.select() (#7953)
im-0 May 24, 2026
e1d9a11
Skip flaky tests (#7961)
ShaharNaveh May 24, 2026
b5ff41c
Align marshal and .pyc with CPython 3.14 (#7958)
youknowone May 24, 2026
d7d9365
General code nitpicks (#7955)
ShaharNaveh May 24, 2026
2fabf38
Impl `sys.audithook` (#7960)
ShaharNaveh May 24, 2026
4389254
Bump qs and express in /wasm/demo (#7959)
dependabot[bot] May 24, 2026
7011942
Add `builtin.PythonFinalizationError` (#7966)
ShaharNaveh May 24, 2026
52305c0
Skip flaky test (#7967)
ShaharNaveh May 24, 2026
bc3d00e
Replace `ahash` with `rapidhash` (#7954)
fanninpm May 25, 2026
a5775e0
Fix thread teardown panic when weakref callback fires during cleanup …
JamesClarke7283 May 25, 2026
f9e4988
Bump github/gh-aw from 0.73.0 to 0.74.4 (#7969)
dependabot[bot] May 25, 2026
6bbe24a
Bump zizmorcore/zizmor-action from 0.5.3 to 0.5.6 (#7970)
dependabot[bot] May 25, 2026
0237a1d
Bump taiki-e/install-action from 2.77.6 to 2.79.1 (#7971)
dependabot[bot] May 25, 2026
f4696ea
Bump peaceiris/actions-gh-pages from 4.0.0 to 4.1.0 (#7972)
dependabot[bot] May 25, 2026
a6fee92
Bump the wasmtime group across 1 directory with 2 updates (#7975)
dependabot[bot] May 25, 2026
b696441
Upgrade `pkcs8` to 0.11 (#7977)
ShaharNaveh May 25, 2026
411230a
Bump j178/prek-action from 2.0.3 to 2.0.4 (#7973)
dependabot[bot] May 25, 2026
021c786
docs: expand AGENTS.md with test marker guidance and CI audit notes (…
JamesClarke7283 May 25, 2026
9701c46
Clippy rules (test related) (#7968)
ShaharNaveh May 25, 2026
fb531ec
Bump cranelift in the wasmtime group across 1 directory (#7980)
dependabot[bot] May 26, 2026
3db172c
Update `ensurepip` to 3.14.5 (#7860)
ShaharNaveh May 26, 2026
dd8d250
Add list support to c-api (#7944)
bschoenmaeckers May 26, 2026
dcb273b
Add capsule support to c-api (#7940)
bschoenmaeckers May 26, 2026
ce79cd4
sqlite3: fix Blob.__setitem__ value range validation (#7981)
ever0de May 27, 2026
1cb24c5
Reject non-ASCII digits in JSON numbers (#7982)
teddygood May 27, 2026
f95b746
Autogen opcodes metadata (#7983)
ShaharNaveh May 27, 2026
ca412fc
Add support for creating functions with the c-api (#7984)
bschoenmaeckers May 27, 2026
1a959cf
Align codegen passes and opcode metadata with CPython (#7987)
youknowone May 28, 2026
30ae48b
Support custom `rustls` providers (#7657)
joshuamegnauth54 May 28, 2026
e80a14b
Align more error messages with CPython 3.14.5 (#7988)
ShaharNaveh May 28, 2026
7d54ba5
Fix `ssl-vendor` (OpenSSL) (#7985)
joshuamegnauth54 May 28, 2026
fc637a1
[META] AI policy (#7914)
ShaharNaveh May 28, 2026
1385c4e
rename ssl-vendor (#7989)
youknowone May 28, 2026
938d421
Update some tests to 3.14.5 (#7990)
ShaharNaveh May 30, 2026
26f817a
Fix broken CI (rustc 1.96) (#7992)
ShaharNaveh May 30, 2026
8018ba6
Add errno.EHWPOISON (#7996)
ShaharNaveh May 31, 2026
0e66439
Tests: update test_codecmaps_{cn,hk,jp,kr,tw}, test_pstats, test_prof…
JamesClarke7283 May 31, 2026
1ce37bf
Update `test_file_eintr.py` to 3.14.5 (#7999)
ShaharNaveh May 31, 2026
36a1722
Add agent skill for adding c-api functions (#8001)
bschoenmaeckers Jun 1, 2026
3e1c3bc
impl `_queue` module + Update `multiprocessing` to 3.14.5 (#7994)
ShaharNaveh Jun 1, 2026
885cf5c
Add `set` object functions to c-api (#8002)
bschoenmaeckers Jun 1, 2026
74b4707
Add mapping c-api functions (#8003)
bschoenmaeckers Jun 2, 2026
2c46b69
Add weakref support to c-api (#8006)
bschoenmaeckers Jun 2, 2026
0c9ed36
CI: Don't skip windows tests (#8004)
ShaharNaveh Jun 2, 2026
6a860b6
Update some tests to 3.14.5 (#7991)
ShaharNaveh Jun 2, 2026
a781980
Update `importlib` to 3.14.5 (#8013)
ShaharNaveh Jun 2, 2026
14cb5dd
Remove node24 installation. It's the default now (#8014)
ShaharNaveh Jun 2, 2026
ef74577
Bump codecov/codecov-action from 6.0.0 to 6.0.1 (#7979)
dependabot[bot] Jun 2, 2026
b5b8258
Update `test_super.py` to 3.14.5 (#8015)
ShaharNaveh Jun 2, 2026
5b2f6bc
Add sequence protocol to the c-api (#8016)
bschoenmaeckers Jun 2, 2026
8e35cc9
Update `asyncio` to 3.14.5 (#8012)
ShaharNaveh Jun 2, 2026
60b1346
Add number protocol functions (#8005)
bschoenmaeckers Jun 3, 2026
ad88d5a
Add slice functions to c-api (#8019)
bschoenmaeckers Jun 3, 2026
37fd1dd
Add bytesarray support to the c-api (#8009)
bschoenmaeckers Jun 3, 2026
6b2bdd9
Update `turtle.py` to 3.14.5 (#8017)
ShaharNaveh Jun 3, 2026
0862451
Update random and cryptography crates (#8010)
joshuamegnauth54 Jun 3, 2026
474758d
Add warning functions to c-api (#8020)
bschoenmaeckers Jun 3, 2026
0eb23ba
Bump github/gh-aw from 0.74.4 to 0.76.1 (#8021)
dependabot[bot] Jun 3, 2026
9f915f7
Bump taiki-e/install-action from 2.79.1 to 2.79.9 (#8022)
dependabot[bot] Jun 3, 2026
56b0715
Bump the wasmtime group across 1 directory with 3 updates (#8023)
dependabot[bot] Jun 3, 2026
e840544
Bump https://github.com/astral-sh/ruff-pre-commit (#8024)
dependabot[bot] Jun 3, 2026
376c4f1
Update thread related tests to 3.14.5 (#8018)
ShaharNaveh Jun 3, 2026
c5f555e
Fix WASM memory allocation failure (#4989) (#7887)
alok-108 Jun 3, 2026
23ba8d6
Update `test_sys{log,_settrace}.py` to 3.14.5 (#8030)
ShaharNaveh Jun 3, 2026
57d1695
Add basic module functions to c-api (#8032)
bschoenmaeckers Jun 3, 2026
f43ae46
xz (#7756)
youknowone Jun 3, 2026
c061013
Add `PyDictProxy_New` to the c-api (#8033)
bschoenmaeckers Jun 3, 2026
0f44672
Bump junction from 1.4.2 to 2.0.0 (#8027)
dependabot[bot] Jun 3, 2026
c2ed8d7
Bump libsqlite3-sys from 0.37.0 to 0.38.0 (#8029)
dependabot[bot] Jun 3, 2026
a0bc9a7
Bump log from 0.4.29 to 0.4.30 (#8036)
dependabot[bot] Jun 4, 2026
99bfbad
Bump memchr from 2.8.0 to 2.8.1 (#8038)
dependabot[bot] Jun 4, 2026
9cc37cd
Bump socket2 from 0.6.3 to 0.6.4 (#8039)
dependabot[bot] Jun 4, 2026
a8e8ba1
Bump xml from 1.2.1 to 1.3.0 (#8037)
dependabot[bot] Jun 4, 2026
d82250b
Bump constant_time_eq from 0.4.2 to 0.5.0 (#8028)
dependabot[bot] Jun 4, 2026
dec9942
Add iter support to c-api (#8035)
bschoenmaeckers Jun 4, 2026
51c97b9
Bump taiki-e/install-action from 2.79.9 to 2.79.10 (#8026)
dependabot[bot] Jun 4, 2026
fb422da
Add `set_attrs!` macro for setting multiple attributes on an object (…
ShaharNaveh Jun 9, 2026
c13db75
General code nits (#8041)
ShaharNaveh Jun 10, 2026
52afc12
Add more object functions to c-api (#8042)
bschoenmaeckers Jun 10, 2026
a575121
Add more dict functions to c-api (#8043)
bschoenmaeckers Jun 10, 2026
ee4e720
Add more unicode functions to c-api (#8044)
bschoenmaeckers Jun 10, 2026
19ca508
Add more list functions to the c-api (#8045)
bschoenmaeckers Jun 10, 2026
16f661e
Bump uuid from 1.23.1 to 1.23.2 (#8046)
dependabot[bot] Jun 10, 2026
3ea3780
Bump lz4_flex from 0.13.0 to 0.13.1 (#8047)
dependabot[bot] Jun 10, 2026
9f05508
Bump rustls-native-certs from 0.8.3 to 0.8.4 (#8049)
dependabot[bot] Jun 10, 2026
28addda
more clippy rules (#8050)
ShaharNaveh Jun 10, 2026
c864885
Add `_blake2` consts (#8053)
ShaharNaveh Jun 10, 2026
a50880e
Update `test_code.py` to 3.14.5 (#8054)
ShaharNaveh Jun 10, 2026
7f75ef1
`scripts/update_lib migrate` to preserve patches on classes (#8057)
ShaharNaveh Jun 10, 2026
b77ada9
Code nitpicks (#8058)
ShaharNaveh Jun 11, 2026
b25155e
Add `_heapq` module (#8059)
ShaharNaveh Jun 11, 2026
50eb2b4
Bump taiki-e/install-action from 2.79.10 to 2.81.1 (#8060)
dependabot[bot] Jun 11, 2026
2450a7b
Bump github/gh-aw from 0.76.1 to 0.77.5 (#8062)
dependabot[bot] Jun 11, 2026
65a2c1d
Skip flakey windows test (#8063)
ShaharNaveh Jun 11, 2026
11e1471
Bump https://github.com/astral-sh/ruff-pre-commit (#8061)
dependabot[bot] Jun 11, 2026
110f27b
Convert claude skills to more generic agent skills (#8064)
bschoenmaeckers Jun 11, 2026
d8380f7
Fix `test_tty.py` tests (#8065)
ShaharNaveh Jun 11, 2026
e452be9
Conditionally skip `test_pty` tests (#8066)
ShaharNaveh Jun 11, 2026
e45bc44
Remove stale patches from `test_traceback.py` (#8068)
ShaharNaveh Jun 11, 2026
4bc80c8
Bump shell-quote from 1.8.2 to 1.8.4 in /wasm/demo (#8069)
dependabot[bot] Jun 11, 2026
ec60bda
Update `pdb.py` to 3.14.5 (#8070)
ShaharNaveh Jun 11, 2026
0f36637
Don't skip test in `test_typing.py` (#8073)
ShaharNaveh Jun 11, 2026
3a81361
Update some tests to 3.14.5 (#8072)
ShaharNaveh Jun 11, 2026
9259d22
Avoid callable iterator deadlock during sentinel comparison (#8040)
doma17 Jun 11, 2026
27fbe24
Don't skip test in `test_tempfile.py` on all platforms (#8067)
ShaharNaveh Jun 11, 2026
65dee6c
Skip flaky asyncio tests (#8075)
ShaharNaveh Jun 11, 2026
f38b8b8
Bump targeted CPython version to 3.14.6 (#8074)
ShaharNaveh Jun 12, 2026
b35c5c3
Remove redundant `to_owned()` calls (#8077)
ShaharNaveh Jun 12, 2026
1526a06
`TODO: Flaky test` -> `TODO: RUSTPYTHON; Flaky test` (#8078)
ShaharNaveh Jun 12, 2026
61f4961
Bump the wasmtime group across 1 directory with 2 updates (#8079)
dependabot[bot] Jun 12, 2026
1ff05a4
Bump chrono from 0.4.44 to 0.4.45 (#8080)
dependabot[bot] Jun 12, 2026
0fe0c70
Bump libsqlite3-sys from 0.38.0 to 0.38.1 (#8081)
dependabot[bot] Jun 12, 2026
f92eed5
Bump bitflags from 2.11.1 to 2.12.1 (#8082)
dependabot[bot] Jun 12, 2026
ac3d442
Update `pyrepl` to 3.14.5 (#7823)
ShaharNaveh Jun 12, 2026
d18d35f
cleanup the signals module (#8076)
ShaharNaveh Jun 12, 2026
404ee2a
Update some of changed libs and tests from `3.14.5` -> `3.14.6` (part…
ShaharNaveh Jun 12, 2026
057e968
Update some of changed libs and tests from `3.14.5` -> `3.14.6` (part…
ShaharNaveh Jun 12, 2026
fa84378
Update some of changed libs and tests from `3.14.5` -> `3.14.6` (part…
ShaharNaveh Jun 12, 2026
be6017c
Update doc DB for CPython 3.14.6 (#8088)
github-actions[bot] Jun 12, 2026
1abbde3
Newtype SignalHandlers (#8089)
ShaharNaveh Jun 14, 2026
c77d553
Bump cranelift in the wasmtime group across 1 directory (#8090)
dependabot[bot] Jun 14, 2026
468eb73
Bump uuid from 1.23.2 to 1.23.3 (#8091)
dependabot[bot] Jun 14, 2026
4493abe
Bump which from 8.0.2 to 8.0.3 (#8092)
dependabot[bot] Jun 14, 2026
0dd90fc
Bump log from 0.4.31 to 0.4.32 (#8093)
dependabot[bot] Jun 14, 2026
a7c1509
Bump pyo3 from 0.28.3 to 0.29.0 (#8094)
dependabot[bot] Jun 14, 2026
e423160
Fix most of `unicodedata`; unmask multiple tests (#7947)
joshuamegnauth54 Jun 14, 2026
3f5d23d
Get all builtin types dynamiclly (#8095)
ShaharNaveh Jun 15, 2026
370fc76
Newtype SigalNum (#8096)
ShaharNaveh Jun 15, 2026
a0fcafd
host_env: Use Rustix for copy_file_range (#8099)
joshuamegnauth54 Jun 15, 2026
12f8b77
Update `libregtest` to 3.14.6 (#8100)
ShaharNaveh Jun 15, 2026
eccbc5e
Update `xml` to 3.14.6 (#8101)
ShaharNaveh Jun 15, 2026
1dc57e8
Update some libs to 3.14.6 (#8102)
ShaharNaveh Jun 15, 2026
c0e3066
Reduce number of string clones when compiling python source code (#8103)
ShaharNaveh Jun 15, 2026
880040d
clippy `significant_drop_in_scrutinee` & `explicit_deref_methods` (#8…
ShaharNaveh Jun 15, 2026
dbfd69e
Update `idlelib` to 3.14.6 (#8105)
ShaharNaveh Jun 15, 2026
6ba2097
Dedent -c command-line parameter value (#8056)
roryyorke Jun 16, 2026
4ba1807
Update doc DB for CPython 3.14.6 (#8106)
github-actions[bot] Jun 16, 2026
d2907b9
Bump https://github.com/astral-sh/ruff-pre-commit (#8110)
dependabot[bot] Jun 16, 2026
4c04731
Bump actions/checkout from 6.0.2 to 6.0.3 (#8111)
dependabot[bot] Jun 16, 2026
984f280
Bump cargo-bins/cargo-binstall from 1.19.1 to 1.20.0 (#8112)
dependabot[bot] Jun 16, 2026
a4a2f41
Bump codecov/codecov-action from 6.0.1 to 7.0.0 (#8113)
dependabot[bot] Jun 16, 2026
80ab37f
Bump memchr from 2.8.1 to 2.8.2 (#8114)
dependabot[bot] Jun 16, 2026
3aa94d8
Bump taiki-e/install-action from 2.81.1 to 2.81.8 (#8115)
dependabot[bot] Jun 16, 2026
808b071
Fix builtin class names not being interned (#8116)
ShaharNaveh Jun 16, 2026
2ee463d
Bump launch-editor from 2.10.0 to 2.14.1 in /wasm/demo (#8119)
dependabot[bot] Jun 16, 2026
08a1d6f
Use KwArgs newtype struct (#8120)
ShaharNaveh Jun 16, 2026
4b0d6b6
host_env: `renameat` support for `os.rename` (#8118)
joshuamegnauth54 Jun 17, 2026
3e047bd
clippy `enum_glob_use` (#8121)
ShaharNaveh Jun 17, 2026
23e076a
Clippy `ref_option` (#8122)
ShaharNaveh Jun 17, 2026
93fbe4f
More clippy rules (#8123)
ShaharNaveh Jun 17, 2026
fe2a7db
Bump the openssl group across 1 directory with 2 updates (#8124)
dependabot[bot] Jun 17, 2026
6a786a7
General code nits (#8107)
ShaharNaveh Jun 22, 2026
0f539cc
Support csv writer QUOTE_STRINGS and QUOTE_NOTNULL (#8109)
doma17 Jun 22, 2026
4b70b01
Skip flaky test at `test_thread.py` (#8125)
ShaharNaveh Jun 22, 2026
2e6ca88
Align patches at `test_types.py` (#8126)
ShaharNaveh Jun 22, 2026
a826600
More clippy rules (#8127)
ShaharNaveh Jun 22, 2026
d748c12
Bump insta from 1.47.2 to 1.48.0 (#8130)
dependabot[bot] Jun 22, 2026
be10ab0
Add stdlib to c-api (#8133)
bschoenmaeckers Jun 22, 2026
828cf21
Replace `&String` -> `&str` (#8136)
ShaharNaveh Jun 22, 2026
8214c90
Fix symtable type_param_block name (#8137)
ShaharNaveh Jun 22, 2026
9bb6ba8
General code nits (#8135)
ShaharNaveh Jun 22, 2026
55b96f9
Run windows tests with `-u all` (#8134)
ShaharNaveh Jun 22, 2026
83beb3e
Use `ast::visitor::Visitor` for collection annotations (#8139)
ShaharNaveh Jun 22, 2026
94ecb56
Bump webpack-dev-server from 5.2.4 to 5.2.5 in /wasm/demo (#8140)
dependabot[bot] Jun 22, 2026
73b0c9f
Remove duplicated code in `compile.rs` (#8141)
ShaharNaveh Jun 22, 2026
18dc6b3
Newtype for `[ir::Block]` (#8142)
ShaharNaveh Jun 22, 2026
af6b517
Implement `collections.defaultdict` in rust (#8132)
ShaharNaveh Jun 23, 2026
efa585b
Bump https://github.com/astral-sh/ruff-pre-commit (#8143)
dependabot[bot] Jun 23, 2026
2e40f78
Bump github/gh-aw from 0.77.5 to 0.79.9 (#8144)
dependabot[bot] Jun 23, 2026
05ff78e
Bump https://github.com/rbubley/mirrors-prettier from v3.8.3 to 3.8.4…
dependabot[bot] Jun 23, 2026
83e3399
Bump the malachite group across 1 directory with 3 updates (#8146)
dependabot[bot] Jun 23, 2026
838b0c4
Bump getrandom in the random group across 1 directory (#8149)
dependabot[bot] Jun 23, 2026
83799fc
Bump webpki-roots in the webpki-root group across 1 directory (#8150)
dependabot[bot] Jun 23, 2026
e629857
Bump which from 8.0.3 to 8.0.4 (#8151)
dependabot[bot] Jun 23, 2026
15a754f
Use `stable` toolchain when updating caches (#8153)
ShaharNaveh Jun 23, 2026
8905b80
Move some of free standing functions to be `ir::Blocks` method (#8154)
ShaharNaveh Jun 23, 2026
39a2fda
unicodedata: Remove UnicodeVersion struct (#8131)
joshuamegnauth54 Jun 24, 2026
c5f318a
Add remaining float functions to c-apo (#8157)
bschoenmaeckers Jun 25, 2026
9acc473
Bump taiki-e/install-action from 2.81.8 to 2.81.11 (#8147)
dependabot[bot] Jun 25, 2026
870ad2d
Move some of free standing functions to be ir::Blocks methods (part 2…
ShaharNaveh Jun 25, 2026
6938f36
Add more number functions to c-api (#8158)
bschoenmaeckers Jun 25, 2026
41d6dab
Update ensurepip to 26.1.2 (cpython 3.14.6) (#8163)
ShaharNaveh Jun 25, 2026
4f9754b
Update `test_repl.py` to 3.14.6 (#8164)
ShaharNaveh Jun 25, 2026
89c46bf
Update `test_tempfile.py` to 3.14.6 (#8165)
ShaharNaveh Jun 25, 2026
23e2723
Update `test_ssl.py` to 3.1.46 (#8166)
ShaharNaveh Jun 25, 2026
4d3ddac
Update some tests to 3.14.6 (#8167)
ShaharNaveh Jun 25, 2026
dda5516
Add allocator functions to c-api (#8168)
bschoenmaeckers Jun 25, 2026
c876709
Add more mapping functions to c-api (#8169)
bschoenmaeckers Jun 25, 2026
3b4c5f6
Align compiler and AST behavior with CPython (#8138)
youknowone Jun 26, 2026
2a344a5
Update `test_subprocess.py` to 3.14.6 (#8171)
ShaharNaveh Jun 26, 2026
83ce1a7
Update `test/signalinterproctester.py` to 3.14.6 (#8173)
ShaharNaveh Jun 26, 2026
c449564
Add more object c-api's (#8170)
bschoenmaeckers Jun 26, 2026
0009dd6
Clean up compiler parity leftovers (#8174)
youknowone Jun 26, 2026
f28ea16
Fix GC weakref clearing order
youknowone Jun 26, 2026
574e86a
Run CDPT in cooperative collection mode
youknowone Jul 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add more mapping functions to c-api (RustPython#8169)
  • Loading branch information
bschoenmaeckers authored Jun 25, 2026
commit c876709388ac81d8abcf0ce17b78ff999ed3a9ae
157 changes: 157 additions & 0 deletions crates/capi/src/abstract_/mapping.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
use crate::{PyObject, pystate::with_vm};
use core::ffi::{CStr, c_char, c_int};
use rustpython_vm::AsObject;

#[unsafe(no_mangle)]
pub unsafe extern "C" fn PyMapping_Check(obj: *mut PyObject) -> c_int {
with_vm(|_vm| {
let obj = unsafe { &*obj };
Ok(obj.mapping_unchecked().check())
})
}

#[unsafe(no_mangle)]
pub unsafe extern "C" fn PyMapping_Size(obj: *mut PyObject) -> isize {
with_vm(|vm| {
Expand All @@ -7,6 +18,11 @@ pub unsafe extern "C" fn PyMapping_Size(obj: *mut PyObject) -> isize {
})
}

#[unsafe(no_mangle)]
pub unsafe extern "C" fn PyMapping_Length(obj: *mut PyObject) -> isize {
unsafe { PyMapping_Size(obj) }
}

#[unsafe(no_mangle)]
pub unsafe extern "C" fn PyMapping_Keys(obj: *mut PyObject) -> *mut PyObject {
with_vm(|vm| {
Expand Down Expand Up @@ -37,6 +53,147 @@ pub unsafe extern "C" fn PyMapping_Items(obj: *mut PyObject) -> *mut PyObject {
})
}

#[unsafe(no_mangle)]
pub unsafe extern "C" fn PyMapping_GetItemString(
obj: *mut PyObject,
key: *const c_char,
) -> *mut PyObject {
with_vm(|vm| {
let obj = unsafe { &*obj };
let key = unsafe { CStr::from_ptr(key) }
.to_str()
.map_err(|_| vm.new_value_error("mapping key must be valid UTF-8"))?;
obj.get_item(key, vm)
})
}

#[unsafe(no_mangle)]
pub unsafe extern "C" fn PyMapping_GetOptionalItem(
obj: *mut PyObject,
key: *mut PyObject,
result: *mut *mut PyObject,
) -> c_int {
with_vm(|vm| {
unsafe {
*result = core::ptr::null_mut();
}
let obj = unsafe { &*obj };
let key = unsafe { &*key };

match obj.get_item(key, vm) {
Ok(value) => {
unsafe {
*result = value.into_raw().as_ptr();
}
Ok(true)
}
Err(err) if err.fast_isinstance(vm.ctx.exceptions.key_error) => Ok(false),
Err(err) => Err(err),
}
})
}

#[unsafe(no_mangle)]
pub unsafe extern "C" fn PyMapping_GetOptionalItemString(
obj: *mut PyObject,
key: *const c_char,
result: *mut *mut PyObject,
) -> c_int {
with_vm(|vm| {
unsafe {
*result = core::ptr::null_mut();
}
let obj = unsafe { &*obj };
let key = unsafe { CStr::from_ptr(key) }
.to_str()
.map_err(|_| vm.new_value_error("mapping key must be valid UTF-8"))?;

match obj.get_item(key, vm) {
Ok(value) => {
unsafe {
*result = value.into_raw().as_ptr();
}
Ok(true)
}
Err(err) if err.fast_isinstance(vm.ctx.exceptions.key_error) => Ok(false),
Err(err) => Err(err),
}
})
}

#[unsafe(no_mangle)]
pub unsafe extern "C" fn PyMapping_HasKey(obj: *mut PyObject, key: *mut PyObject) -> c_int {
with_vm(|vm| {
let obj = unsafe { &*obj };
let key = unsafe { &*key };
obj.get_item(key, vm).is_ok()
})
}

#[unsafe(no_mangle)]
pub unsafe extern "C" fn PyMapping_HasKeyString(obj: *mut PyObject, key: *const c_char) -> c_int {
with_vm(|vm| {
let obj = unsafe { &*obj };
if let Ok(key) = unsafe { CStr::from_ptr(key) }.to_str() {
obj.get_item(key, vm).is_ok()
} else {
false
}
})
}

#[unsafe(no_mangle)]
pub unsafe extern "C" fn PyMapping_HasKeyWithError(
obj: *mut PyObject,
key: *mut PyObject,
) -> c_int {
with_vm(|vm| {
let obj = unsafe { &*obj };
let key = unsafe { &*key };

match obj.get_item(key, vm) {
Ok(_) => Ok(true),
Err(err) if err.fast_isinstance(vm.ctx.exceptions.key_error) => Ok(false),
Err(err) => Err(err),
}
})
}

#[unsafe(no_mangle)]
pub unsafe extern "C" fn PyMapping_HasKeyStringWithError(
obj: *mut PyObject,
key: *const c_char,
) -> c_int {
with_vm(|vm| {
let obj = unsafe { &*obj };
let key = unsafe { CStr::from_ptr(key) }
.to_str()
.map_err(|_| vm.new_value_error("mapping key must be valid UTF-8"))?;

match obj.get_item(key, vm) {
Ok(_) => Ok(true),
Err(err) if err.fast_isinstance(vm.ctx.exceptions.key_error) => Ok(false),
Err(err) => Err(err),
}
})
}

#[unsafe(no_mangle)]
pub unsafe extern "C" fn PyMapping_SetItemString(
obj: *mut PyObject,
key: *const c_char,
value: *mut PyObject,
) -> c_int {
with_vm(|vm| {
let obj = unsafe { &*obj };
let key = unsafe { CStr::from_ptr(key) }
.to_str()
.map_err(|_| vm.new_value_error("mapping key must be valid UTF-8"))?;
let value = unsafe { &*value }.to_owned();
obj.set_item(key, value, vm)
})
}

#[cfg(false)]
mod tests {
use pyo3::prelude::*;
Expand Down