Commit Graph

29405 Commits

Author SHA1 Message Date
Bénédikt Tran 9ded6f0830
gh-111178: fix incorrect function signatures in docs (#132395)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-04-11 14:59:38 +00:00
Jelle Zijlstra 07b8d3117f
gh-132261: Store annotations at hidden internal keys in the class dict (#132345) 2025-04-10 21:13:26 -07:00
Barney Gale 66cdb2bd8a
GH-123599: `url2pathname()`: handle authority section in file URL (#126844)
In `urllib.request.url2pathname()`, if the authority resolves to the
current host, discard it. If an authority is present but resolves somewhere
else, then on Windows we return a UNC path (as before), and on other
platforms we raise `URLError`.

Affects `pathlib.Path.from_uri()` in the same way.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-10 19:58:04 +00:00
Serhiy Storchaka 1557da622c
gh-106482: Clarify documentation of character set in RE (#106517)
Co-authored-by: Martin Panter <vadmium@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-10 16:41:41 +03:00
Jiayu Yi 5fbe23ee4e
Fix example code in curses tutorial (#126446) 2025-04-10 15:06:38 +03:00
Liam DeVoe 4a88bbacb3
Docs: Add a missing trailing full stop (#130561) 2025-04-10 14:51:20 +03:00
180909 65357032e8
gh-72631: Fix wrong documentation for GzipFile.peek (#29820)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2025-04-10 14:21:32 +03:00
Jo 5f1aed1c7e
docs: Fix typo in context_aware_warnings flag (#132340) 2025-04-10 05:19:01 +01:00
Adam Turner e329f74e7d
GH-132330: Synchronise ``Doc/includes/typestruct.h`` with ``PyTypeObject`` (#132332) 2025-04-10 01:51:56 +01:00
Neil Schemenauer d687900f98
gh-128384: Use a context variable for warnings.catch_warnings (gh-130010)
Make `warnings.catch_warnings()` use a context variable for holding
the warning filtering state if the `sys.flags.context_aware_warnings`
flag is set to true.  This makes using the context manager thread-safe in
multi-threaded programs.

Add the `sys.flags.thread_inherit_context` flag.  If true, starting a new
thread with `threading.Thread` will use a copy of the context
from the caller of `Thread.start()`.

Both these flags are set to true by default for the free-threaded build
and false for the default build.

Move the Python implementation of warnings.py into _py_warnings.py.

Make _contextvars a builtin module.

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-04-09 16:18:54 -07:00
h-vetinari 67ded6a4fa
update comment about LLVM bug relevant for `--with-tail-call-interp` performance (#132297) 2025-04-09 22:50:38 +08:00
Serhiy Storchaka f5f1ac84b3
gh-112068: C API: Add support of nullable arguments in PyArg_Parse (GH-121303) 2025-04-08 22:08:00 +03:00
Cody Maloney 8421b648e9
gh-132246: Add PEP 688 to C Buffer Protocol docs (#132249) 2025-04-08 10:43:27 -07:00
Tian Gao efd8aca62c
gh-106670: Fix a typo in doc of pdb's exceptions command (#132277) 2025-04-08 12:19:16 -04:00
Hugo van Kemenade c5e856a5dc Merge branch 'main' of https://github.com/python/cpython 2025-04-08 17:08:21 +03:00
Serhiy Storchaka 0e4cf9ce7c
gh-50333: Deprecate support of non-tuple sequences in PyArg_ParseTuple() (GH-128374)
Non-tuple sequences are deprecated as argument for the "(items)" format unit
in PyArg_ParseTuple() and other argument parsing functions if items contains
format units which store borrowed buffer or reference (e.g. "s" and "O").

str and bytearray are no longer accepted as valid sequences.
2025-04-08 14:26:32 +03:00
Hugo van Kemenade 29af6cee02 Python 3.14.0a7 2025-04-08 14:20:51 +03:00
Bénédikt Tran 3eda146035
gh-74598: add `fnmatch.filterfalse` for excluding names matching a patern (#121185) 2025-04-08 10:11:25 +00:00
David Brochart 297e05932d
Fixed a typo in the documentation (#132005) 2025-04-08 11:43:11 +03:00
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) 403886c28d
gh-132021: Add bool type to the list of allowed JSON key types (#132048)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2025-04-08 11:25:46 +03:00
sobolevn f7305a06c7
gh-115942: Add `locked` to several multiprocessing locks (#115944)
Co-authored-by: mpage <mpage@cs.stanford.edu>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-08 11:14:12 +03:00
Ee Durbin 40844164b1
Add psfhosted Plausible instance to analytics (#132252) 2025-04-08 10:37:42 +03:00
Stan Ulbrych f5639d87f5
gh-130521: Add Open Graph meta tags to template pages (#130523)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-07 21:58:50 +01:00
Adam Turner f0dcb29d3a
gh-118761: Cover the import time optimisations in What's New (#132035)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-07 17:27:54 +00:00
Bénédikt Tran fd1b98dd1d
gh-130843: add UUIDv7 timestamp recipes (#132154)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-07 17:21:56 +02:00
Hugo van Kemenade ce724571b3
Docs HTML: Remove self-closing tags (#132220)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-04-07 18:21:13 +03:00
sobolevn 8b62374b34
gh-132221: Fix `__match_args__` generation docs in `dataclasses.rst` (#132222) 2025-04-07 17:46:47 +03:00
Hugo van Kemenade e80ed2cf75
gh-123299: List PEPs 758 and 768 in 3.14 release highlights (#132211) 2025-04-07 15:09:46 +01:00
Prometheus3375 316974382a
gh-131912: Use different grouping options for the integral and fractional parts (#132170) 2025-04-07 14:02:49 +02:00
Sergey B Kirpichev 6eaa4aeef2
Docs: Add a single table summary for ``cmath`` (#131887)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-04-07 00:36:21 +01:00
Brian Schubert e2476398ee
gh-132168: Add `__class_getitem__` to `ctypes.py_object` (#132169) 2025-04-06 22:05:19 +01:00
Emma Smith 0788948dcb
gh-84481: Add ZipFile.data_offset attribute (#132165)
* Add ZipFile.data_offset attribute

This attribute provides the offset to zip data from the start of the file, when available.

* Add blurb-it

* Try fixing class ref in NEWS
2025-04-06 13:51:42 -07:00
Alex Waygood 42e3a8410b
gh-132139: 3.14 what's new: elaborate on why you can no longer set `Union` attributes (#132157) 2025-04-06 17:51:05 +02:00
Jelle Zijlstra dbfc6a417a
gh-132139: Document that you can no longer set attributes on unions (#132146) 2025-04-06 13:43:09 +01:00
Rafael Fontenelle 376631829a
Fix numbered list syntax in programming.rst (#130158) 2025-04-05 20:20:21 +01:00
Adam Turner 561965fa5c
Generate social media preview cards for the documentation (#132101)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2025-04-05 14:20:06 +00:00
Semyon Moroz 37bc3865c8
gh-85162: Add `HTTPSServer` to `http.server` to serve files over HTTPS (#129607)
The `http.server` module now supports serving over HTTPS using the `http.server.HTTPSServer` class.
This functionality is also exposed by the command-line interface (`python -m http.server`) through the
`--tls-cert`, `--tls-key` and `--tls-password-file` options.
2025-04-05 08:49:48 +00:00
Yuki Kobayashi 99e9798d61
Docs: document `plistlib.InvalidFileException` (#132069) 2025-04-05 08:46:17 +00:00
Prometheus3375 06a110f522
gh-131912: Improve description of grouping options in the format specification docs (#132030)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-05 10:28:50 +02:00
Jelle Zijlstra ac14d4a23f
gh-129463, gh-128593: Simplify ForwardRef (#129465) 2025-04-05 04:36:34 +00:00
Jelle Zijlstra 7473c600a5
gh-131933: Document UnionType/Union merger in What's New (#131941)
Co-authored-by: Alex Waygood
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-04 11:15:31 -07:00
Bénédikt Tran 0a97427ee5
gh-99108: Implement HACL* HMAC (#130157)
A new extension module, `_hmac`, now exposes the HACL* HMAC (formally verified) implementation.

The HACL* implementation is used as a fallback implementation when the OpenSSL implementation of HMAC
is not available or disabled. For now, only named hash algorithms are recognized and SIMD support provided
by HACL* for the BLAKE2 hash functions is not yet used.
2025-04-04 19:04:00 +02:00
Jelle Zijlstra 5518c2ae09
gh-128661: Remove DeprecationWarning in evaluate_forward_ref (#128930)
It doesn't make sense to use a deprecation for evaluate_forward_ref,
as it is a new function in Python 3.14 and doesn't have compatibility
guarantees.

I considered making it throw an error if type_params it not passed and
there is no owner. However, I think this is too unfriendly for users. The
case where this param is really needed is fairly esoteric and I don't think
this case is worth the pain of forcing users to write "type_params=()".
2025-04-03 09:52:17 -07:00
Pablo Galindo Salgado 943cc1431e
gh-131591: Implement PEP 768 (#131937)
Co-authored-by: Ivona Stojanovic <stojanovic.i@hotmail.com>
Co-authored-by: Matt Wozniski <godlygeek@gmail.com>
2025-04-03 16:20:01 +01:00
Tian Gao 6bd9689426
gh-60115: Support frozen modules for linecache.getline() (#131638) 2025-04-02 19:50:01 -04:00
Donghee Na 25275bda79
gh-131544: Update docs for PyType_AddWatcher (gh-132015) 2025-04-02 15:04:07 +00:00
Pablo Galindo Salgado c2ac662f28
gh-131831: Implement PEP 758 – Allow except and except* expressions without parentheses (#131833) 2025-04-01 19:04:56 +00:00
mpage 053c285f6b
gh-130704: Strength reduce `LOAD_FAST{_LOAD_FAST}` (#130708)
Optimize `LOAD_FAST` opcodes into faster versions that load borrowed references onto the operand stack when we can prove that the lifetime of the local outlives the lifetime of the temporary that is loaded onto the stack.
2025-04-01 10:18:42 -07:00
Rafael Fontenelle 23a658b9af
Minor improvements to the programming FAQ (#127261)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-04-01 08:19:06 +01:00
Sergey B Kirpichev 2505573f20
gh-121249: Note struct module changes in What's New (#131867)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-04-01 07:16:36 +00:00
Sergey B Kirpichev 0a3eb8855c
gh-125957: sync argument naming in sphinx docs of the cmath and help() (#125958)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-01 08:16:11 +01:00
Malcolm Smith fe5c4c53e7
gh-131531: Add `android.py package` command (#131532)
Adds a `package` entry point to the `android.py` build script to support
creating an Android distribution artefact.
2025-04-01 08:46:29 +08:00
Bénédikt Tran ba11f45dd9
gh-130843: expose 48-bit timestamp for UUIDv7 (#131838) 2025-03-31 14:32:54 +02:00
Adam Dangoor edfbd8c062
gh-131885: Document that `dict.setdefault` and `dict.get` take no keyword arguments (#128208) 2025-03-30 09:22:57 +00:00
Alexander Ershov 044a1e13d5
gh-129994: update docs when using `dualstack_ipv6` in `socket.create_server` (#129996) 2025-03-30 08:19:36 +00:00
Totosuki a5949986d6
gh-127541: Update os.walk example (GH-127765)
Update os.walk example to be more modern, skip `__pycache__` dirs rather than `CVS` dirs.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-28 23:25:13 -07:00
Simon Legner 52b5eb95b7
gh-131236: allow to generate multiple UUIDs at once via CLI (#131218)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-26 22:49:28 +02:00
Idan Noiman b9ca438daa
gh-131741: Add documentation for Windows version detection change in `platform` (#131742)
Document the behavior change between 3.11 & 3.12, where ``platform`` now correctly detects Windows 11 and Windows Server releases past Windows Server 2012.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Wulian <1055917385@qq.com>
2025-03-26 14:50:37 +00:00
Ralf Gommers ac12de2e6a
document that `sys._is_gil_enabled` is CPython-specific (#131748) 2025-03-26 17:32:52 +05:30
Bénédikt Tran 1d6a2e6481
gh-111178: fix UBSan for example code in `extending/newtypes_tutorial` docs (GH-131606)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-03-24 17:15:32 +01:00
David Lowry-Duda d2d886215c
gh-115684: Clarify datetime `replace` documentation (#116519)
* Clarify datetime `replace` documentation

In #115684, HopedForLuck noted that `datetime.date.replace()`
documentation was confusing because it looked like it would be changing
immutable objects.

This documentation change specifies that the `replace()` methods in
`datetime` return new objects. This uses similar wording to the
documentation for `datetime.combine()`, which specifies that a new
datetime is returned. This is also similar to wording for
`string.replace()`, except `string.replace()` emphasizes that a "copy"
is returned.

Resolves #115684.

* Include reviewer comments

Thanks Privat33r-dev for the comments!

---------

Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
2025-03-24 11:33:16 -04:00
Petr Viktorin 0e53038ea8
gh-128715: Expose ctypes.CField, with info attributes (GH-128950)
- Restore max field size to sys.maxsize, as in Python 3.13 & below
- PyCField: Split out bit/byte sizes/offsets.
- Expose CField's size/offset data to Python code
- Add generic checks for all the test structs/unions, using the newly exposed attrs
2025-03-24 14:18:34 +01:00
Petr Viktorin 01ea4c77e5
gh-123909: Remove obsolete note in PyType_FromMetaclass docs (GH-131506)
Docs of the other `PyType_From*` functions link to `PyType_FromMetaclass`,
which noted that they differ for backwards compatibility reasons.
The note is no longer relevant in 3.14.
The other functions have `versionchanged` blurbs.
2025-03-24 13:06:21 +01:00
Zsolt Dollenstein 5fc889ffbf
no-issue: Fix typo in importlib.metadata.rst (gh-131596) 2025-03-23 23:01:29 +09:00
Kanishk Pachauri fd459b1153
gh-130283: update deprecated links and examples in `urllib.request` docs (#130284)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-23 13:29:29 +00:00
Sebb 557d2d20d4
gh-121529: Document `from_` parameter in `_mboxMMDF` public methods (#121530) 2025-03-23 13:10:47 +01:00
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) 8b7d20d3a9
gh-131457: Fix typo in BNF description of function signatures (#131460) 2025-03-22 10:54:48 +03:00
AN Long 00a9844888
gh-131453: Add additional constants to winsound module (GH-131454) 2025-03-20 16:35:52 +00:00
Adam Turner 443c0cd17c
gh-127833: Use `productionlist` nodes to implement the `grammar-snippet` directive (#130376)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
2025-03-20 15:35:20 +00:00
Peter Bierma 86d5fa95cf
gh-127989: C API: Refer to "attached thread states" instead of the GIL (GH-127990)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-20 13:06:59 +01:00
Barney Gale f141e8ec2a
GH-123599: Deprecate duplicate `pathname2url()` implementation (#127380)
Call `urllib.request.pathname2url()` from `pathlib.Path.as_uri()`, and
deprecate the duplicate implementation in `PurePath`.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-20 00:54:36 +00:00
Barney Gale 8abfaba5a6
GH-125866: Deprecate `nturl2path` module (#131432)
Deprecate the `nturl2path` module. Its functionality is merged into
`urllib.request`.

Add `tests.test_nturl2path` to exercise `nturl2path`, as it's no longer
covered by `test_urllib`.
2025-03-19 19:33:01 +00:00
Steve Dower 63a638c43f
gh-91349: Replace zlib with zlib-ng in Windows build (GH-131438) 2025-03-19 19:03:25 +00:00
Adam Turner c1a02f9101
GH-121970: Extract `pydoc_topics` into a new extension (#131256) 2025-03-19 18:35:11 +00:00
Cody Maloney a4832f6b9a
gh-131117: Update tp_finalize example to use PyErr_GetRaisedException (#131118)
The tp_finalize C API doc used PyErr_Fetch() and PyErr_Restore() in
its example code. That API was deprecated in 3.12.

Update to point to the suggested replacement function
PyErr_GetRaisedException() which has a sample usage.
2025-03-19 18:27:55 +01:00
R. David Murray 6146295a5b
gh-90548: Make musl test skips smarter (fixes Alpine errors) (#131313)
* Make musl test skips smarter (fixes Alpine errors)

A relatively small number of tests fail when the underlying c library is
provided by musl.  This was originally reported in bpo-46390 by
Christian Heimes.  Among other changes, these tests were marked for
skipping in gh-31947/ef1327e3 as part of bpo-40280 (emscripten support),
but the skips were conditioned on the *platform* being emscripten (or
wasi, skips for which ere added in 9b50585e02).

In gh-131071 Victor Stinner added a linked_to_musl function to enable
skipping a test in test_math that fails under musl, like it does on a
number of other platforms.  This check can successfully detect that
python is running under musl on Alpine, which was the original problem
report in bpo-46390.

This PR replaces Victor's solution with an enhancement to
platform.libc_ver that does the check more cheaply, and also gets the
version number.  The latter is important because the math test being
skipped is due to a bug in musl that has been fixed, but as of this
checkin date has not yet been released.  When it is, the test skip can
be fixed to check for the minimum needed version.

The enhanced version of linked_to_musl is also used to do the skips of
the other tests that generically fail under musl, as opposed to
emscripten or wasi only failures.  This will allow these tests to be
skipped automatically on Alpine.

This PR does *not* enhance libc_ver to support emscripten and wasi, as
I'm not familiar with those platforms; instead it returns a version
triple of (0, 0, 0) for those platforms.  This means the musl tests will
be skipped regardless of musl version, so ideally someone will add
support to libc_ver for these platforms.

* Platform tests and bug fixes.

In adding tests for the new platform code I found a bug in the old code:
if a valid version is passed for version and it is greater than the
version found for an so *and* there is no glibc version, then the
version from the argument was returned.  The code changes here fix
that.

* Add support docs, including for some preexisting is_xxx's.

* Add news item about libc_ver enhancement.

* Prettify platform re expression using re.VERBOSE.
2025-03-19 13:05:09 -04:00
Petr Viktorin 4bced29a74
gh-130587: Add hand-written docs for non-OP tokens (GH-130588)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2025-03-19 16:42:11 +01:00
Yuki Kobayashi a0478c9f0c
Docs: Fix documentation for "PyTypeObject Definition" (GH-130936)
The structure definition for `PyTypeObject` is in `Include/cpython/object.h`,
not in `Include/object.h`.
2025-03-19 14:46:32 +01:00
Andrew Svetlov 61b4b2c57c
gh-131417: Mention asyncio Future and Task in docs for generic classes list (#131422)
Mention asyncio Future and Task in docs for generic classes list
2025-03-19 10:05:23 +01:00
partev 267c06d6a8
Docs: fix shell command formatting (#131310)
replace "zypper in" with "zypper install" to avoid incorrect highlighting
2025-03-19 09:42:47 +02:00
Barney Gale d783d7b51d
GH-126367: `url2pathname()`: handle NTFS alternate data streams (#131428)
Adjust `url2pathname()` to decode embedded colon characters in Windows
URIs, rather than bailing out with an `OSError`.
2025-03-18 23:37:12 +00:00
Daniel Pope c1b42db9e4
gh-130914: Make graphlib.TopologicalSorter.prepare() idempotent (#131317)
Closes #130914: Make graphlib.TopologicalSorter.prepare() idempotent

Relax the rules so that `.prepare()` can be called multiple times, provided that no work has been passed out by `.get_ready()` yet.
2025-03-18 16:28:00 -05:00
Yuki Kobayashi f819900245
gh-118915: Document `PY_MONITORING_IS_INSTRUMENTED_EVENT` (GH-128026) 2025-03-18 17:34:01 +01:00
Kanishk Pachauri 77d2fd4413
gh-130132: properly free resources in `urrlib.urlopen` examples (#130280)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-18 09:27:05 +00:00
Guy Jacoby 3f50f96586
gh-131094: Refine `math.isclose` docs (#131139) 2025-03-18 10:13:26 +01:00
Tian Gao a936af924e
gh-120144: Make it possible to use `sys.monitoring` for bdb and make it default for pdb (#124533) 2025-03-17 18:34:37 -04:00
Erlend E. Aasland f48887fb97
gh-131002: clarify how to enforce sqlite3 column types for generated fields (#131006) 2025-03-17 22:26:27 +00:00
Irit Katriel ffc2f1dd1c
gh-130080: implement PEP 765 (#130087) 2025-03-17 20:48:54 +00:00
Petr Viktorin 30d5205849
gh-116666: Add "token" glossary term (GH-130888)
Add glossary entry for `token`, and link to it.
Avoid talking about tokens in the SyntaxError intro (errors.rst); at this point
tokenization is too much of a technical detail. (Even to an advanced reader,
the fact that a *single* token is highlighted isn't too relevant. Also, we don't
need to guarantee that it's a single token.)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-17 17:05:47 +01:00
Yuki Kobayashi 9a634c5c0c
Docs: Fix incorrect sphinx markup for a class member (GH-130970) 2025-03-17 16:28:56 +01:00
Semyon Moroz 85c04f80fd
gh-93096: Update and document `pickletools` CLI (#131273) 2025-03-17 09:36:30 +00:00
AN Long bf4c1bf344
gh-131327: Document winsound.SND_APPLICATION (#131328)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-16 16:27:24 +01:00
Bénédikt Tran 3185e3115c
gh-131277: allow `EnvironmentVarGuard` to unset more than one environment variable at once (#131280)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-03-16 14:09:33 +01:00
donBarbos 9558d22ac3
gh-130160: use `.. program::` directive for documenting `doctest` CLI (#131034)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-16 11:53:22 +00:00
donBarbos 7ae9c5dd25
gh-130160: use `.. program::` directive for documenting `http.server` CLI (#131010) 2025-03-15 18:28:56 +02:00
Tian Gao 27fc62cf4f
gh-121468: Add current asyncio task as a convenience variable in pdb (#124367) 2025-03-14 14:46:26 -04:00
Hugo van Kemenade 77b2c933ca Python 3.14.0a6 2025-03-14 17:05:02 +02:00
Hugo van Kemenade ca1bedc9a4
gh-121970: Revert "GH-121970: Extract ``pydoc_topics`` into a new extension (#129116)" (#131245)
Lint / lint (push) Failing after 5m2s Details
mypy / Run mypy on ${{ matrix.target }} (Lib/_pyrepl) (push) Failing after 31s Details
mypy / Run mypy on ${{ matrix.target }} (Lib/test/libregrtest) (push) Failing after 32s Details
mypy / Run mypy on ${{ matrix.target }} (Tools/cases_generator) (push) Successful in 11s Details
mypy / Run mypy on ${{ matrix.target }} (Tools/build) (push) Successful in 4m39s Details
Tests / Change detection (push) Failing after 26m43s Details
Tests / Docs (push) Has been skipped Details
Tests / Check if Autoconf files are up to date (push) Has been skipped Details
Tests / Check if generated files are up to date (push) Has been skipped Details
Tests / Windows ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (Win32, false, windows-latest) (push) Has been skipped Details
Tests / Windows ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (arm64, false, windows-latest) (push) Has been skipped Details
Tests / Windows ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (arm64, true, windows-latest) (push) Has been skipped Details
Tests / Windows ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (x64, false, windows-latest) (push) Has been skipped Details
Tests / Windows ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (x64, true, windows-latest) (push) Has been skipped Details
Tests / Windows MSI${{ '' }} (arm64) (push) Has been skipped Details
Tests / Windows MSI${{ '' }} (x64) (push) Has been skipped Details
Tests / Windows MSI${{ '' }} (x86) (push) Has been skipped Details
Tests / macOS ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (false, ${{ github.repository_owner != 'python' }}, ghcr.io/cirruslabs/macos-runner:sonoma) (push) Has been skipped Details
Tests / macOS ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (false, ${{ github.repository_owner != 'python' }}, macos-13) (push) Has been skipped Details
Tests / macOS ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (false, ${{ github.repository_owner != 'python' }}, macos-14) (push) Has been skipped Details
Tests / macOS ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (true, ${{ github.repository_owner != 'python' }}, ghcr.io/cirruslabs/macos-runner:sonoma) (push) Has been skipped Details
Tests / macOS ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (true, ${{ github.repository_owner != 'python' }}, macos-14) (push) Has been skipped Details
Tests / Ubuntu ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} ${{ fromJSON(matrix.bolt) && '(bolt)' || '' }} (false, false, ubuntu-24.04) (push) Has been skipped Details
Tests / Ubuntu ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} ${{ fromJSON(matrix.bolt) && '(bolt)' || '' }} (false, false, ubuntu-24.04-arm) (push) Has been skipped Details
Tests / Ubuntu ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} ${{ fromJSON(matrix.bolt) && '(bolt)' || '' }} (false, true, ubuntu-24.04) (push) Has been skipped Details
Tests / Ubuntu ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} ${{ fromJSON(matrix.bolt) && '(bolt)' || '' }} (false, true, ubuntu-24.04-arm) (push) Has been skipped Details
Tests / Ubuntu ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} ${{ fromJSON(matrix.bolt) && '(bolt)' || '' }} (true, false, ubuntu-24.04) (push) Has been skipped Details
Tests / Ubuntu SSL tests with OpenSSL (3.0.15, ubuntu-24.04) (push) Has been skipped Details
Tests / Ubuntu SSL tests with OpenSSL (3.1.7, ubuntu-24.04) (push) Has been skipped Details
Tests / Ubuntu SSL tests with OpenSSL (3.2.3, ubuntu-24.04) (push) Has been skipped Details
Tests / Ubuntu SSL tests with OpenSSL (3.3.2, ubuntu-24.04) (push) Has been skipped Details
Tests / Ubuntu SSL tests with OpenSSL (3.4.0, ubuntu-24.04) (push) Has been skipped Details
Tests / WASI (push) Has been skipped Details
Tests / Hypothesis tests on Ubuntu (push) Has been skipped Details
Tests / Address sanitizer (ubuntu-24.04) (push) Has been skipped Details
Tests / Thread sanitizer ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (false) (push) Has been skipped Details
Tests / Thread sanitizer ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (true) (push) Has been skipped Details
Tests / Cross build Linux (push) Has been skipped Details
Tests / CIFuzz (address) (push) Has been skipped Details
Tests / CIFuzz (memory) (push) Has been skipped Details
Tests / CIFuzz (undefined) (push) Has been skipped Details
Tests / All required checks pass (push) Has been skipped Details
mypy / Run mypy on ${{ matrix.target }} (Tools/clinic) (push) Failing after 31s Details
mypy / Run mypy on ${{ matrix.target }} (Tools/peg_generator) (push) Failing after 32s Details
mypy / Run mypy on ${{ matrix.target }} (Tools/jit) (push) Failing after 5m3s Details
mypy / Run mypy on ${{ matrix.target }} (Tools/wasm) (push) Failing after 31s Details
Mark stale pull requests / stale (push) Has been skipped Details
Revert "GH-121970: Extract ``pydoc_topics`` into a new extension (#129116)"

This reverts commit 01bcf13a1c.
2025-03-14 16:25:56 +02:00
donBarbos f9d0531a8d
gh-93096: Update and document `pickle` CLI (#131097)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-03-14 14:15:35 +01:00
Hugo van Kemenade 3d797e49c8
gh-92897: Doc: the check_home removal has been scheduled for 3.15 (#130586) 2025-03-14 12:29:23 +02:00
sharktide 6b932edc52
gh-130814: Enhance documentation for Python C API type objects (#130817)
The "Type Objects" title in `c-api/typeobj.rst`, duplicating the title of `c-api/type.rst`,
has been changed to "Type Objects Structures", thereby slightly improving Sphinx
search.
2025-03-14 10:53:13 +01:00
Stan Ulbrych e4ac196aaa
gh-124269: Simplify `typing.Annotated` docs (#130770)
---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-14 10:46:57 +01:00
Enzo Bonnal d7d22899e2
gh-74028: update `whatsnew/3.14.rst` post gh-125663 (#131214)
Tail calling interpreter / ${{ matrix.target }} (x86_64, 19, macos-13, x86_64-apple-darwin/clang) (push) Waiting to run Details
Tail calling interpreter / ${{ matrix.target }} (x86_64, 19, ubuntu-24.04, free-threading) (push) Waiting to run Details
Tail calling interpreter / ${{ matrix.target }} (x86_64, 19, ubuntu-24.04, x86_64-unknown-linux-gnu/gcc) (push) Waiting to run Details
Lint / lint (push) Failing after 4m33s Details
mypy / Run mypy on ${{ matrix.target }} (Lib/_pyrepl) (push) Successful in 4m39s Details
mypy / Run mypy on ${{ matrix.target }} (Lib/test/libregrtest) (push) Successful in 4m42s Details
mypy / Run mypy on ${{ matrix.target }} (Tools/build) (push) Successful in 4m37s Details
mypy / Run mypy on ${{ matrix.target }} (Tools/cases_generator) (push) Successful in 4m38s Details
mypy / Run mypy on ${{ matrix.target }} (Tools/clinic) (push) Successful in 4m38s Details
mypy / Run mypy on ${{ matrix.target }} (Tools/jit) (push) Successful in 4m38s Details
Tests / Change detection (push) Failing after 23m50s Details
Tests / Docs (push) Has been skipped Details
Tests / Check if Autoconf files are up to date (push) Has been skipped Details
Tests / Check if generated files are up to date (push) Has been skipped Details
Tests / Windows ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (Win32, false, windows-latest) (push) Has been skipped Details
Tests / Windows ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (arm64, false, windows-latest) (push) Has been skipped Details
Tests / Windows ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (arm64, true, windows-latest) (push) Has been skipped Details
Tests / Windows ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (x64, false, windows-latest) (push) Has been skipped Details
Tests / Windows ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (x64, true, windows-latest) (push) Has been skipped Details
Tests / Windows MSI${{ '' }} (arm64) (push) Has been skipped Details
Tests / Windows MSI${{ '' }} (x64) (push) Has been skipped Details
Tests / Windows MSI${{ '' }} (x86) (push) Has been skipped Details
Tests / macOS ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (false, ${{ github.repository_owner != 'python' }}, ghcr.io/cirruslabs/macos-runner:sonoma) (push) Has been skipped Details
Tests / macOS ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (false, ${{ github.repository_owner != 'python' }}, macos-13) (push) Has been skipped Details
Tests / macOS ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (false, ${{ github.repository_owner != 'python' }}, macos-14) (push) Has been skipped Details
Tests / macOS ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (true, ${{ github.repository_owner != 'python' }}, ghcr.io/cirruslabs/macos-runner:sonoma) (push) Has been skipped Details
Tests / macOS ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (true, ${{ github.repository_owner != 'python' }}, macos-14) (push) Has been skipped Details
Tests / Ubuntu ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} ${{ fromJSON(matrix.bolt) && '(bolt)' || '' }} (false, false, ubuntu-24.04) (push) Has been skipped Details
Tests / Ubuntu ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} ${{ fromJSON(matrix.bolt) && '(bolt)' || '' }} (false, false, ubuntu-24.04-arm) (push) Has been skipped Details
Tests / Ubuntu ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} ${{ fromJSON(matrix.bolt) && '(bolt)' || '' }} (false, true, ubuntu-24.04) (push) Has been skipped Details
Tests / Ubuntu ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} ${{ fromJSON(matrix.bolt) && '(bolt)' || '' }} (false, true, ubuntu-24.04-arm) (push) Has been skipped Details
Tests / Ubuntu ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} ${{ fromJSON(matrix.bolt) && '(bolt)' || '' }} (true, false, ubuntu-24.04) (push) Has been skipped Details
Tests / Ubuntu SSL tests with OpenSSL (3.0.15, ubuntu-24.04) (push) Has been skipped Details
Tests / Ubuntu SSL tests with OpenSSL (3.1.7, ubuntu-24.04) (push) Has been skipped Details
Tests / Ubuntu SSL tests with OpenSSL (3.2.3, ubuntu-24.04) (push) Has been skipped Details
Tests / Ubuntu SSL tests with OpenSSL (3.3.2, ubuntu-24.04) (push) Has been skipped Details
Tests / Ubuntu SSL tests with OpenSSL (3.4.0, ubuntu-24.04) (push) Has been skipped Details
Tests / WASI (push) Has been skipped Details
Tests / Hypothesis tests on Ubuntu (push) Has been skipped Details
Tests / Address sanitizer (ubuntu-24.04) (push) Has been skipped Details
Tests / Thread sanitizer ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (false) (push) Has been skipped Details
Tests / Thread sanitizer ${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }} (true) (push) Has been skipped Details
Tests / Cross build Linux (push) Has been skipped Details
Tests / CIFuzz (address) (push) Has been skipped Details
Tests / CIFuzz (memory) (push) Has been skipped Details
Tests / CIFuzz (undefined) (push) Has been skipped Details
Tests / All required checks pass (push) Has been skipped Details
mypy / Run mypy on ${{ matrix.target }} (Tools/wasm) (push) Successful in 4m37s Details
mypy / Run mypy on ${{ matrix.target }} (Tools/peg_generator) (push) Successful in 4m40s Details
Mark stale pull requests / stale (push) Has been skipped Details
2025-03-13 23:22:04 +01:00
Victor Stinner 10cbd1fe88
gh-130947: Add again PySequence_Fast() to the limited C API (#130948)
Add again PySequence_Fast() to the limited C API.

Add unit tests.
2025-03-13 13:00:57 +01:00
donBarbos 3a189af4b2
gh-93096: Remove CLI interface for `difflib` (#131099) 2025-03-13 13:22:16 +02:00
Oleg Iarygin 328f8b8856
gh-93096: Make `mimetypes` CLI tool public (#93097)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-03-13 13:19:22 +02:00
Enzo Bonnal a005835f69
gh-74028: add `buffersize` parameter to `concurrent.futures.Executor.map` for lazier behavior (#125663)
`concurrent.futures.Executor.map` now supports limiting the number of submitted
tasks whose results have not yet been yielded via the new `buffersize` parameter.

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-13 11:57:53 +01:00
Russell Keith-Magee dd6d24e9d2
gh-130940: Modify default behavior of `PyConfig.use_system_logger` to enable on iOS (#131172)
Modify default behavior of use_system_log to enable on iOS.
2025-03-13 14:28:49 +08:00
Daniel Pope e0637cebe5
gh-129349: Accept bytes in bytes.fromhex()/bytearray.fromhex() (#129844)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-12 11:40:11 +01:00
Gerardwx e0bc9d2a0c
Replace link to historical TypedDict PEP with current document on typing.python… (#131096)
* Replace link to historical PEP with current document on typing.python.org

* Update Doc/library/typing.rst

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>

---------

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2025-03-11 12:45:31 -04:00
Petr Viktorin ad0f618ab3
gh-129675: Update documentation for tp_basicsize & tp_itemsize (#129850)
* Update documentation for tp_basicsize & tp_itemsize

- Add alignment requirement
- Mention that ob_size is unreliable if you don't control it
- Add some links for context
- basicsize should include the base type in generaly not just PyObject

This adds a “by-the-way” link to `PyObject_New`, which shouldn't be
used for GC types. In order to be comfortable linking to it, I also
add a link to `PyObject_GC_New` from its docs. And the same for
`*Var` variants, while I'm here.

* Strongly suggest Py_SIZE & Py_SET_SIZE
2025-03-11 11:21:18 +01:00
RUANG (James Roy) faadb446d9
gh-46236: Add missing PyUnicode_Append() doc (#130531)
* Add missing PyUnicode_Append() doc

* Change the copied content

* Add '`` ``'

* Change doc

* Add PyUnicode_AppendAndDel function doc

* Change doc

* Add PyUnicode_AppendAndDel to refcounts

* Change doc

* Change doc

Co-authored-by: Petr Viktorin <encukou@gmail.com>

* Change doc

---------

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-03-11 10:28:17 +01:00
Ken Jin fe186d76cf
Minor nits to whats new tail call wording (#130912) 2025-03-11 10:57:35 +08:00
stratakis ecdf6b15b0
gh-118518: Minor improvements to perf docs (#130866)
Minor improvements to perf docs
2025-03-10 21:51:21 +00:00
Jean-Christophe Fillion-Robin c3487c941d
gh-82909: Update PC/pyconfig.h to allow disabling pragma based auto-linking (GH-19740)
Define Py_NO_LINK_LIB to build extension disabling pragma based auto-linking. This is relevant when using build-system generator (e.g CMake) where the linking is explicitly handled
2025-03-10 17:40:17 +00:00
Yuki Kobayashi 7cc99a54b7
gh-101100: Fix sphinx warnings in `library/asyncio-subprocess.rst` (#130994) 2025-03-10 12:38:08 +00:00
Stan Ulbrych 98fa4a49fe
gh-80421: Correct definitions of time (#130984)
Based on the Wikipedia article, UTC is better said to be a successor than a renaming of GTC and language agnostic rather than an English-French compromise.
2025-03-09 16:09:23 -04:00
donBarbos c240c2d88a
gh-130160: use `.. program::` directive for documenting `pdb` CLI (#130996) 2025-03-09 11:55:23 -04:00
donBarbos 92e5f826ac
gh-130160: use `.. program::` directive for documenting `webbrowser` CLI (#130995)
use `.. program::` directive for documenting `webbrowser` CLI
2025-03-09 09:57:59 +03:00
Affan Shaikhsurab a3990df612
gh-123726: Document caveats of zipfile.Path around name sanitization (#130537)
Add a note to the `zipfile.Path` class documentation clarifying that it does not sanitize filenames. This emphasizes the caller's responsibility to validate or sanitize inputs, especially when handling untrusted ZIP archives, to prevent path traversal vulnerabilities. The note also references the `extract` and `extractall` methods for comparison and suggests using `os.path.abspath` and `os.path.commonpath` for safe filename resolution.
2025-03-08 16:37:05 -05:00
morotti b1b4f9625c
gh-117151: IO performance improvement, increase io.DEFAULT_BUFFER_SIZE to 128k (GH-118144)
Co-authored-by: rmorotti <romain.morotti@man.com>
2025-03-07 11:36:12 -08:00
Boris Verkhovskiy e5527f2cdd
Correct function name in `Doc/extending/embedding.rst` (#127539) 2025-03-07 14:06:36 +01:00
Sebastian Rittau c6dd2348ca
gh-127647: Add typing.Reader and Writer protocols (#127648) 2025-03-06 07:36:19 -08:00
Ken Jin 9c691500f9
gh-128563: Clarify wording in Whats new for Tail call (#130911)
Clarify wording in Whats new for Tail call
2025-03-06 13:38:05 +00:00
Ken Jin e4a60248b0
gh-128563: Add correction note to tail call in whats new (#130908)
* Add correction note to tail call in whats new

* Update 3.14.rst
2025-03-06 14:43:53 +08:00
Bartosz Sławecki 293fa3433e
gh-85795: Raise a clear error when `super()` is used in `typing.NamedTuple` subclasses (#130082) 2025-03-05 20:45:47 -08:00
Charles Machalow 5e73ece95e
gh-128041: Fix incorrect bullet placement in "What's new" (GH-130900) 2025-03-05 22:59:56 +00:00
Tshepang Mbambo 1b5db5adfe
GH-130153: Reword the wildcard matching part of the tutorial (GH-129954) 2025-03-05 14:59:47 -08:00
Charles Machalow ba05a4ebcb
gh-128041: Add `terminate_workers` and `kill_workers` methods to ProcessPoolExecutor (GH-130849)
This adds two new methods to `multiprocessing`'s `ProcessPoolExecutor`:
- **`terminate_workers()`**: forcefully terminates worker processes using `Process.terminate()`
- **`kill_workers()`**: forcefully kills worker processes using `Process.kill()`

These methods provide users with a direct way to stop worker processes without `shutdown()` or relying on implementation details, addressing situations where immediate termination is needed.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Sam Gross @colesbury
Commit-message-mostly-authored-by: Claude Sonnet 3.7 (because why not -greg)
2025-03-05 14:31:42 -08:00
Sebastian Rittau 4f6218959e
Update links from typing.readthedocs.io to typing.python.org (#130877) 2025-03-05 17:26:44 +02:00
Adam Turner e53d105872
GH-125722: Increase minimum supported Sphinx to 8.2.0 (#130444) 2025-03-05 00:31:01 +00:00
Tian Gao b6769e9404
gh-125377: Improve tab indentation for pdb multi-line input (#130471) 2025-03-04 15:45:38 -05:00
Jelle Zijlstra dc6d66f44c
gh-105499: Merge typing.Union and types.UnionType (#105511)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2025-03-04 11:44:19 -08:00
Tomas R. e091520fdb
gh-126085: Add `tp_iter` to TypeAliasType to allow star unpacking (#127981) 2025-03-04 11:34:59 -08:00
Tian Gao 63b6ec31c4
gh-82987: Stop on calling frame unconditionally for inline breakpoints (#130493) 2025-03-04 11:35:47 -05:00
Sam Gross efadc5874c
Revert "gh-128041: Add `terminate_workers` and `kill_workers` methods to ProcessPoolExecutor (GH-128043)" (#130838)
The test_concurrent_futures.test_process_pool test is failing in CI.

This reverts commit f97e4098ff.
2025-03-04 11:19:06 -05:00
sobolevn 63ffb406bb
gh-129567: Add a note to `typing.TypedDict` docs about name mangling (#130233) 2025-03-04 18:15:00 +03:00
Petr Viktorin d91cc9db15
gh-129666: Add C11/C++11 to docs and -pedantic-errors to GCC/clang test_c[pp]ext tests (GH-130692)
Disable pedantic check for c++03 (unlimited API)

Also add a check for c++03 *limited* API, which passes in pedantic mode
after removing a comma in the `PySendResult` declaration, and allowing
`long long`.
2025-03-04 14:10:09 +01:00
Bénédikt Tran 3929af5e3a
gh-89083: add support for UUID version 7 (RFC 9562) (#121119)
Add support for generating UUIDv7 objects according to RFC 9562, §5.7 [1].

The functionality is provided by the `uuid.uuid7()` function. The implementation
is based on a 42-bit counter as described by Method 1, §6.2 [2] and guarantees
monotonicity within the same millisecond.

[1]: https://www.rfc-editor.org/rfc/rfc9562.html#section-5.7
[2]: https://www.rfc-editor.org/rfc/rfc9562.html#section-6.2

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Éric <merwok@netwok.org>
2025-03-04 10:47:19 +01:00
Yuki Kobayashi b3c18bfd82
gh-130711: Document `PyBaseObject_Type` (GH-130712)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-03-03 15:08:05 +01:00
Yuki Kobayashi a105f99019
gh-101100: Fix sphinx warnings in `library/email.errors.rst` (#130774) 2025-03-03 11:56:45 +02:00
Victorien 373eb1b47a
gh-101100: Fix Sphinx documentation warnings in `collections.rst` (#130629) 2025-03-03 11:46:38 +02:00
Mike Castle a85eeb9771
gh-129015: Improve disambiguation between `NotImplemented` and `NotImplementedError` (#129562)
---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-03 09:23:41 +01:00
Charles Machalow f97e4098ff
gh-128041: Add `terminate_workers` and `kill_workers` methods to ProcessPoolExecutor (GH-128043)
This adds two new methods to `multiprocessing`'s `ProcessPoolExecutor`:
- **`terminate_workers()`**: forcefully terminates worker processes using `Process.terminate()`
- **`kill_workers()`**: forcefully kills worker processes using `Process.kill()`

These methods provide users with a direct way to stop worker processes without `shutdown()` or relying on implementation details, addressing situations where immediate termination is needed.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Commit-message-mostly-authored-by: Claude Sonnet 3.7 (because why not -greg)
2025-03-02 18:01:45 -08:00
Bénédikt Tran c6513f7a62
gh-128481: indicate that the default value for `FrameSummary.end_lineno` changed in 3.13 (#130755)
The value taken by `FrameSummary.end_lineno` when passing `end_lineno=None` changed in gh-112097.

Previously, a `end_lineno` could be specified to be `None` directly but since 939fc6d, passing None makes
the constructor use the value of `lineno` instead.
2025-03-02 18:16:51 +01:00
Bénédikt Tran 990ad272f6
gh-89083: add support for UUID version 6 (RFC 9562) (#120650)
Add support for generating UUIDv6 objects according to RFC 9562, §5.6 [1].

The functionality is provided by the `uuid.uuid6()` function which takes as inputs an optional 48-bit
hardware address and an optional 14-bit clock sequence. The UUIDv6 temporal fields are ordered
differently than those of UUIDv1, thereby providing improved database locality.

[1]: https://www.rfc-editor.org/rfc/rfc9562.html#section-5.6

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-02 12:41:56 +01:00
Damien 051f0e5683
gh-128481: Improve documentation for `traceback.FrameSummary` (#128484)
Complete the `traceback.FrameSummary` signature and add missing
documentation for the `colno` and `end_{col,line}no` attributes.
2025-03-02 10:29:12 +01:00
Arijit Kumar Das 37145cb89f
Fix grammar typo in `Doc/c-api/arg.rst` (#130741) 2025-03-02 10:24:34 +01:00
Tim Hoffmann c71e55869e
Add link in the `importlib.metadata.version()` docs (#130739)
Link the specification for the returned data makes it clearer what this is
and what the format of the version string can be.
2025-03-02 10:23:32 +01:00
Apostol Fet 5181ddb29f
gh-130160: use `.. program::` directive for documenting `cProfile` CLI (#130314)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-01 23:39:25 +03:00