[WIP] gh-141510: PEP 814: Add built-in frozendict type#141508
[WIP] gh-141510: PEP 814: Add built-in frozendict type#141508vstinner wants to merge 25 commits intopython:mainfrom
Conversation
* Basic tests * Bare minimum documentation * Support frozendict in marshal, pickle, json * Replace dict with frozendict in many stdlib modules Co-Authored-by: Donghee Na <donghee.na@python.org> Co-Authored-by: Marco Sulla <github@marco.sulla.e4ward.com>
|
This PR was created mainly to play with PEP 814 implementation, not to be merged. If PEP 814 is accepted, this PR should be splitted into smaller parts, easier to review. |
mypy fails with |
|
Tests / Android (x86_64) (pull_request) does crash, I'm not sure why. |
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
It should be fixed by Add PyFrozenDict_Type to static_types commit. |
Co-authored-by: kalvdans <github@kalvdans.no-ip.org>
|
TODO: Provide better error on hashing a mutable value: |
Add GET_USED() macro.
|
This PR is a draft combining all changes to adopt frozendict in the stdlib. It's too big to be merged. I started to split this PR into smaller PRs with #144757 as a starting point: most basic PR just to add the frozendict type. |
|
@vstinner is it purposed that this draft PR is linked in the documentation at „reference implementation“ in PEP 814? I know that this includes more than the other PR, but I think that it was probably better to link the real PRs with the real changes made because they include really every single change correctly rather than a draft, no? |
|
@benediktjohannes PEPs are historical documents (PEP 814 will soon have a banner to this effect), so it's fine for https://peps.python.org/pep-0814/#reference-implementation to point to this PR. It was the reference implementation at the time the PEP was written, discussed and accepted. The real implementation is another matter, and is being committed in smaller PRs. We can follow along via the issue, #141510. |
|
Thanks! |
📚 Documentation preview 📚: https://cpython-previews--141508.org.readthedocs.build/