gh-90015: Document that PEP-604 unions do not support forward references (GH-105366)
(cherry picked from commit fbdee000de)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
typing: Improve documentation of generic classes and aliases (GH-105369)
(cherry picked from commit d63a7c3694)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
gh-97797: Improve documentation for typing.Annotated (GH-105365)
(cherry picked from commit e26d296984)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Check for error after each call to PyUnicode_FromStringAndSize().
(cherry picked from commit a24a780d93)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
typing docs: Make the PEPs list an expandable section, hidden by default (GH-105353)
(cherry picked from commit d7645124f5)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
`typing.NewType` docs: the future performance improvements are now in the past (GH-105354)
(cherry picked from commit 5f65ff0370)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
gh-105286: Further improvements to `typing.py` docstrings (GH-105363)
(cherry picked from commit 9a89f1bf1e)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
gh-94172: Update keyfile removal documentation (GH-105392)
Remove the "deprecated:: 3.6" markup, since the parameters (like
keyfile and certfile) got removed in Python 3.12.
(cherry picked from commit 2b8e6e5712)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-102304: Fix Py_INCREF() stable ABI in debug mode (#104763)
When Python is built in debug mode (if the Py_REF_DEBUG macro is
defined), the Py_INCREF() and Py_DECREF() function are now always
implemented as opaque functions to avoid leaking implementation
details like the "_Py_RefTotal" variable or the
_Py_DecRefTotal_DO_NOT_USE_THIS() function.
* Remove _Py_IncRefTotal_DO_NOT_USE_THIS() and
_Py_DecRefTotal_DO_NOT_USE_THIS() from the stable ABI.
* Remove _Py_NegativeRefcount() from limited C API.
(cherry picked from commit 92022d8416)
GH-105162: Account for `INSTRUMENTED_RESUME` in gen.close/throw. (GH-105187)
(cherry picked from commit 601ae09f0c)
Co-authored-by: Mark Shannon <mark@hotpy.org>
gh-104399: Use newer libtommath APIs when necessary (GH-104407)
(cherry picked from commit 00d73caf80)
Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
* gh-102304: doc: Add links to Stable ABI and Limited C API (#105345)
* Add "limited-c-api" and "stable-api" references.
* Rename "stable-abi-list" reference to "limited-api-list".
* Makefile: Document files regenerated by "make regen-limited-abi"
* Remove first empty line in generated files:
- Lib/test/test_stable_abi_ctypes.py
- PC/python3dll.c
(cherry picked from commit bae415ad02)
* gh-102304: Fix up Simple ABI doc (GH-105351)
(cherry picked from commit 0202aa002e)
gh-98963: Restore the ability to have a dict-less property. (GH-105262)
Ignore doc string assignment failures in `property` as has been the
behavior of all past Python releases. (the docstring is discarded)
(cherry picked from commit 418befd75d)
This fixes a behavior regression in 3.12beta1 where an AttributeError was being raised in a situation it has never been in the past. It keeps the existing unusual single situation where AttributeError does get raised.
Existing widely deployed projects depend on this not raising an exception.
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-104882: Docs: fix description of relationship between `socket.getblocking()` and `socket.gettimeout()` (GH-105026)
(cherry picked from commit 5a5ed7a3e6)
Co-authored-by: Joe Geisbauer <joegeisbauer@gmail.com>
gh-104690 Disallow thread creation and fork at interpreter finalization (GH-104826)
Disallow thread creation and fork at interpreter finalization.
in the following functions, check if interpreter is finalizing and raise `RuntimeError` with appropriate message:
* `_thread.start_new_thread` and thus `threading`
* `posix.fork`
* `posix.fork1`
* `posix.forkpty`
* `_posixsubprocess.fork_exec` when a `preexec_fn=` is supplied.
---------
(cherry picked from commit ce558e69d4)
Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-89415: Mention new `IP_*` constants in `socket` module in the docs (GH-105266)
(cherry picked from commit eaff9c39aa)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred (GH-105185)
(cherry picked from commit ee26ca13a1)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
When I added the relevant condition to type_ready_set_bases() in gh-103912, I had missed that the function also sets tp_base and ob_type (if necessary). That led to problems for third-party static types.
We fix that here, by making those extra operations distinct and by adjusting the condition to be more specific.
(cherry picked from commit 1469393)
Co-authored-by: Eric Snow ericsnowcurrently@gmail.com