can_modify_dict() is stricter than ASSERT_DICT_LOCKED() for
frozendict. It uses PyUnstable_Object_IsUniquelyReferenced() which
matters for free-threaded builds.
Replace anydict_setitem_take2() with setitem_take2_lock_held(). It's
no longer useful to have two functions.
Ensure that APPENDS and SETITEMS are never used for a batch of size 1.
Ensure that ADDITEMS and SETITEMS are never used for a batch of size 0.
This harmonizes the C implementation with the Python implementation
which already guarantees this and makes a pickle a tiny bit smaller
with a tiny chance (about 0.1%).
Saves 1 byte for list and dict with size 1001, 2001, ...
Saves 2 bytes for set and dict with size 1000, 2000, ...
Since the code for rule NR2 is already here, to support CJK unified
ideographs and Tangut ideographs, it can also be used for other names
derived by rule NR2.
* Docs: a start on an 'improve this page' feature
* pr feedback: simplify the link, and don't scare people with the cla
* pr feedback answered
- use the actual page URL
- tighten the wording
* fix the improve link on the improve page
* news item
* Update Doc/improve-page.rst
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
* fix whitespace
* A nojs version of the page
* comments to help people keep the two pages in sync
* protect against XSS
* use template for issues from the nojs page
* use the template from the JS page as well
* give the docs issue template a fillable description field
* ugh, getting sloppy
* remove more sloppiness
---------
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Align the QSBR thread state array to a 64-byte cache line boundary
and add padding at the end of _PyThreadStateImpl. Depending on heap
layout, the QSBR array could end up sharing a cache line with a
thread's tlbc_index, causing QSBR quiescent state updates to contend
with reads of tlbc_index in RESUME_CHECK. This is sensitive to
earlier allocations during interpreter init and can appear or
disappear with seemingly unrelated changes.
Either change alone is sufficient to fix the specific issue, but both
are worthwhile to avoid similar problems in the future.
Add TYPE_FROZENDICT to the marshal module.
Add C API functions:
* PyAnyDict_Check()
* PyAnyDict_CheckExact()
* PyFrozenDict_Check()
* PyFrozenDict_CheckExact()
* PyFrozenDict_New()
Add PyFrozenDict_Type C type.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Johnson <me@adamj.eu>
Co-authored-by: Benedikt Johannes <benedikt.johannes.hofer@gmail.com>
The unparser was not handling the `is_lazy` attribute on Import and
ImportFrom AST nodes, causing lazy imports to be unparsed as regular
imports. This broke the round-trip (parse → unparse → reparse) for
any file containing `lazy import` statements.
* %D support for strptime, including test and Doc update
* additional %D test
* change documentation example date for %D so it is more legible to non-US readers
* change testing date for %D so it is more legible to non-US readers
* mv News blurb to Library, consistent with previous %F change
* change invalid format code from %D to C-standard unused %!
* Fix erroneous and misleading example Doc to %y from %Y, use correct C99+ definition for C99 %D; update additional tests
---------
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>