(cherry picked from commit c7e7a4b969)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Automerge-Triggered-By: GH:Fidget-Spinner
Getting an attribute via attrib.get() simultaneously with replacing
the attrib dict can lead to access to deallocated dict.
(cherry picked from commit d15cdb2f32)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Expanded ``astuple()`` docs, warning about deepcopy being applied
and providing a workaround.
Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit c1f93f0d37)
Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
* Fix thread lock in zlib.Decompress.flush() may go wrong
Getting `.unconsumed_tail` before acquiring the thread lock may mix up decompress state.
(cherry picked from commit 7edb6270a7)
Co-authored-by: Ma Lin <animalize@users.noreply.github.com>
Automerge-Triggered-By: GH:gpshead
"make regen-all" now produces the same output when run from a
directory other than the source tree: when building Python out of the
source tree.
(cherry picked from commit 253b7a0a9f)
The docstring for `typing.NewType` is no longer strictly accurate, now that `NewType` is a class, rather than a function
(cherry picked from commit 93c65df83c)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This does two changes that are quite related.
0. it add that variable binding can occur in pattern matching, an update of 3.10
which seems to have been omitted from the list of bindings
1. Given how long the sentence already was, with even subcases in the middle of
the sentence, the commit breaks the sentence into an actual list.
(cherry picked from commit cd876c8493)
Co-authored-by: Arthur Milchior <arthur@milchior.fr>
Automerge-Triggered-By: GH:asvetlov
(cherry picked from commit 4dd82194f4)
Co-authored-by: Zbigniew Siciarz <zbigniew@siciarz.net>
Co-authored-by: Zbigniew Siciarz <zbigniew@siciarz.net>
Document the `port` parameter to `loop.create_server` in `asyncio`. In
particular, note that if `host` resolves to multiple network interfaces,
passing in `port=0` will result in a different random unused port being
used for each interface.
Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit d71c7bc733)
Co-authored-by: Jim Crist-Harif <jcristharif@gmail.com>
Co-authored-by: Jim Crist-Harif <jcristharif@gmail.com>
It is now considered a historical accident that e.g. `for` loops and the `iter()` built-in function do not require the iterators they work with to define `__iter__`, only `__next__`.
(cherry picked from commit be36e06340)
Co-authored-by: Brett Cannon <brett@python.org>
(cherry picked from commit 4fad314246)
Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
Special handling is needed, because for non-slots dataclasses the instance attributes are not set: reading from a field just references the class's attribute of the same name, which contains the default value. But this doesn't work for classes using __slots__: they don't read the class's attribute. So in that case (and that case only), initialize the instance attribute. Handle this for both normal defaults, and for fields using default_factory.
(cherry picked from commit d3062f672c)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
Suggested by Stefan Pochmann.
(cherry picked from commit 48744db70e)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>