When overriding the `__new__` method of an enum, the underlying data type should be created directly; i.e. .
member = object.__new__(cls)
member = int.__new__(cls, value)
member = str.__new__(cls, value)
Calling `super().__new__()` finds the lookup version of `Enum.__new__`, and will now raise an exception when detected.
(cherry picked from commit d48760b2f1)
Co-authored-by: Colin Watson <cjwatson@debian.org>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
gh-107755: Document the correct default value of slice step (GH-107756)
Document the correct default value of slice step.
(cherry picked from commit 9bf350b066)
Co-authored-by: wim glenn <hey@wimglenn.com>
GH-108202: Document ``calendar``'s command-line interface (GH-109020)
(cherry picked from commit f0f96a9f40)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
(cherry picked from commit 21da4980f5)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* Express functions which take argument as a C string in terms of
functions which take Python object.
* Use "note" directive for PyMapping_HasKey() and
PyMapping_HasKeyString() notes.
(cherry picked from commit 6f97eeec22)
gh-104372: Drop the GIL around the vfork() call. (#104782)
On Linux where the `subprocess` module can use the `vfork` syscall for
faster spawning, prevent the parent process from blocking other threads
by dropping the GIL while it waits for the vfork'ed child process `exec`
outcome. This prevents spawning a binary from a slow filesystem from
blocking the rest of the application.
Fixes#104372.
(cherry picked from commit d08679212d)
`ast` docs: Fix incorrect link on `keyword` (GH-108728)
In two places, Sphinx was erroneously adding links to the `keyword` module instead of the `ast.keyword` class
(cherry picked from commit c1e2f3b2f7)
Co-authored-by: Alex Povel <git@alexpovel.de>
Mention Ellipsis pickling in the docs (GH-103660)
(cherry picked from commit 14ec0bb7c3)
Co-authored-by: sterliakov <50529348+sterliakov@users.noreply.github.com>
(cherry picked from commit 8178a88bd8)
- Add param docstrings
- Link to os.SEEK_* constants
- Mention the return value in the initial paragraph
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Fix grammatical error in stringprep documentation (GH-108414)
Remove the word "them", which didn't make grammatical sense.
(cherry picked from commit cd0a8aece9)
Co-authored-by: Matthew James Kraai <kraai@ftbfs.org>
Co-authored-by: KRAAI, MATTHEW [VISUS] <mkraai@its.jnj.com>
Co-authored-by: Philipp A <flying-sheep@web.de>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.11] Datamodel: Add headings to the standard type hierarchy (GH-108146)
Dedent content according to the new layout..
(cherry picked from commit 2b7bff0655)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Fix indentation
https://docs.python.org/3/howto/pyporting.html was written for another time. In this patch:
- material that frames Python 3 as "new" is removed
- descriptions and directions have been trimmed
(cherry picked from commit 809ea7c4b6)
Co-authored-by: Daniele Procida <daniele@vurt.org>
gh-70766: Mention the object getstate caveat in 3.11 What's new. (GH-108379)
(cherry picked from commit b6be18812c)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-108267: Dataclasses docs: Fix object.__setattr__ typo (GH-108355)
Fixed a sentence in dataclasses.rst
Changed "__setattr__" to "object.__setattr__" in a section that was specifically supposed to refer to the __setattr__ method of the object class. Also suppressed the link to the data model docs for __setattr__, since we're talking about a specific __setattr__ implementation, not __setattr__ methods in general.
(cherry picked from commit 79fdacc005)
Co-authored-by: FrozenBob <30644137+FrozenBob@users.noreply.github.com>
When changing docs, it was easy to find text in topics.py, and I
wondered whether I was supposed to edit it. Thankfully, the top of the
file says it's auto-generated, so I knew I didn't have to edit it. But I
didn't know what started the auto-generation process.
It's part of the release process, so I'll leave a note here for future
editors.
(cherry picked from commit dac1e36490)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
(cherry picked from commit 8f3d09bf5d)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
- no parameters of create_aggregate() are positional-only
- all parameters of create_collation() are positional-only
(cherry picked from commit 893215a4e7)
Co-authored-by: Erlend E. Aasland <erlend@python.org>