Commit graph

1004 commits

Author SHA1 Message Date
Miss Islington (bot)
4b093e1796
[3.14] gh-136672: Docs: Move Enum functions and add examples (GH-136791) (#137688)
Co-authored-by: RafaelWO <38643099+RafaelWO@users.noreply.github.com>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2025-09-11 12:15:55 +03:00
Miss Islington (bot)
d29c38eeb9
[3.14] gh-138295: Fix a grammar issue in the descriptor HOWTO (GH-138296) (#138299)
Co-authored-by: Fangyi Zhou <me@fangyi.io>
2025-09-08 18:00:06 +03:00
Miss Islington (bot)
b0069f14af
[3.14] GH-101100: Resolve reference warnings in whatsnew/3.7.rst (GH-138410) (#138423)
GH-101100: Resolve reference warnings in whatsnew/3.7.rst (GH-138410)

Resolve reference warnings in whatsnew/3.7.rst
(cherry picked from commit dd86fb4ba5)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-03 06:26:29 +00:00
Miss Islington (bot)
36a1e1aaf7
[3.14] gh-137026: Add an explainer guide for asyncio (GH-137215) (#137581)
Co-authored-by: Alexander Nordin <alexander.f.nordin@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-08-15 13:14:39 +03:00
Miss Islington (bot)
f2981acd6b
[3.14] gh-137043: mention PyList_GET_ITEM as unsafe borrowed API in free-threading docs (GH-137042) (#137045)
Co-authored-by: Guido Imperiale <crusaderky@gmail.com>
2025-07-23 20:45:55 +03:00
Miss Islington (bot)
163f532530
[3.14] gh-136882: Update stale link in the basic logging tutorial. (GH-136885) (#136905)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-07-21 12:04:39 +03:00
Miss Islington (bot)
2cb5792836
[3.14] gh-94503: Update logging cookbook example with info on addressing log injection. (GH-136446) (GH-136449)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-07-09 09:00:30 +01:00
Miss Islington (bot)
8f06a9c9ce
[3.14] gh-94503: Update logging cookbook with an example of uniformly handling newlines in output. (GH-136217) (GH-136357)
(cherry picked from commit d05423a90c)
2025-07-07 10:18:27 +01:00
Miss Islington (bot)
b86d3f0d69
[3.14] gh-136135: Doc: Fix some broken links (GH-136137) (GH-136220)
gh-136135: Doc: Fix some broken links (GH-136137)
(cherry picked from commit 135ba86212)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-07-03 00:57:39 +00:00
Miss Islington (bot)
388e8c3676
[3.14] Replace capi-sig mailing list with discuss.python.org (GH-136211) (#136213)
Replace `capi-sig` mailing list with `discuss.python.org` (GH-136211)
(cherry picked from commit 7afe1adb00)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-07-02 20:55:08 +03:00
Miss Islington (bot)
ad6c90f5ba
[3.14] gh-135110: Fix misleading generator.close() documentation (GH-135152) (GH-135985)
gh-135110: Fix misleading `generator.close()` documentation (GH-135152)

The documentation incorrectly stated that generator.close() 'raises' a
GeneratorExit exception. This was misleading because the method doesn't
raise the exception to the caller - it sends the exception internally
to the generator and returns None.
(cherry picked from commit 0d76dccc3b)

Co-authored-by: Connor Denihan <188690869+cdenihan@users.noreply.github.com>
2025-06-26 13:34:33 +00:00
Miss Islington (bot)
19740b7a7a
[3.14] gh-135965: Delete duplicate word in isolating-extensions howto (GH-135964) (#135977)
gh-135965: Delete duplicate word in isolating-extensions howto (GH-135964)

Change use use to use.
(cherry picked from commit ffb2a02f98)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
2025-06-26 11:47:17 +00:00
Miss Islington (bot)
a7abb8c8e6
[3.14] Docs: Add missing lines between regex and text (GH-134505) (GH-135718)
Docs: Add missing lines between regex and text (GH-134505)
(cherry picked from commit 754190287e)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-06-19 15:07:12 +00:00
Miss Islington (bot)
941011374a
[3.14] gh-119132: Remove "experimental" tag from the CPython free-threading. (gh-135550) (gh-135565)
---------
(cherry picked from commit f079979599)

Co-authored-by: Donghee Na <donghee.na@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: T. Wouters <thomas@python.org>
2025-06-16 14:58:14 +00:00
Miss Islington (bot)
890607fa05
[3.14] gh-134835: Remove outdated list from howto/urllib2.rst (GH-134844) (#134984)
gh-134835: Remove outdated list from `howto/urllib2.rst` (GH-134844)

🫖
(cherry picked from commit 3704171415)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-31 17:55:48 +00:00
Miss Islington (bot)
f734531bbe
[3.14] gh-134160: Improve multi-phase init note on isolation & subinterpreters (GH-134775) (#134932)
gh-134160: Improve multi-phase init note on isolation & subinterpreters (GH-134775)

(cherry picked from commit eb145fabbd)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-31 18:41:07 +01:00
Miss Islington (bot)
a1b6252c88
[3.14] gh-133678: Document C API third party tools (GH-134526) (#134793)
gh-133678: Document C API third party tools (GH-134526)
(cherry picked from commit c3c88064f5)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Steve Dower <steve.dower@python.org>
2025-05-27 15:45:08 +00:00
Miss Islington (bot)
162e3f3511
[3.14] gh-134595: Update HOWTO to reflect change in CIBW option (GH-134598) (#134622)
Co-authored-by: Jasper Wong <111284156+3willows@users.noreply.github.com>
2025-05-24 07:21:34 +00:00
Miss Islington (bot)
ee3a0efc9d
[3.14] Docs: fix link in free-threading-python.rst (GH-134548) (#134555) 2025-05-23 00:42:48 +00:00
Miss Islington (bot)
7e7391810f
[3.14] gh-134370: Added clarification on instance annotations (GH-134387) (#134509)
gh-134370: Added clarification on instance annotations (GH-134387)

Instances of classes cannot have annotations,
however sometimes they will erroneously have the
__annotations__ attribute
(cherry picked from commit bd4046f4f8)

Co-authored-by: Alex Kautz <alex@takemobi.com>
2025-05-22 13:52:37 +00:00
Miss Islington (bot)
9cef5c1f65
[3.14] Add notes on nogil & reinitialization to the Opt-Out section in Module Isolation HOWTO (GH-134141) (GH-134492)
Add notes on nogil & reinitialization to the Opt-Out section in Module Isolation HOWTO (GH-134141)
(cherry picked from commit 1f0a294e8c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-05-22 10:20:11 +02:00
Steve Dower
7686c752b3
[3.14] gh-133779: Revert Windows generation of pyconfig.h and go back to a static header. (GH-133966)
Extension builders must specify Py_GIL_DISABLED if they want to link to the free-threaded builds.
This was usually the case already, but this change guarantees it in all circumstances.
2025-05-19 21:24:53 +01:00
Hugo van Kemenade
b092705907 Python 3.14.0b1 2025-05-06 18:33:52 +03:00
Serhiy Storchaka
ac56f8cc8d
gh-133306: Support \z as a synonym for \Z in regular expressions (GH-133314)
\Z was an error inherited from PCRE 0.95. It was fixed in PCRE 2.0.
In other engines, \Z means not “anchor at string end”, but
“anchor before optional newline at string end”.

\z means “anchor at string end” in most RE engines.
2025-05-03 07:54:33 +00:00
Yongzi Li
cd76eff26e
Docs: fix a couple typos in Doc/ (GH-132927)
fix minor typos
2025-04-27 15:56:58 -07:00
Stan Ulbrych
08e331d05e
PR 132638 typo fix (#132785)
Update remote_debugging.rst
2025-04-21 20:33:19 +00:00
ivonastojanovic
2b1dac6039
gh-131591: Add remote debugging attachment protocol documentation (#132638)
Add a developer-facing document describing the protocol used by
remote_exec(pid, script) to execute Python code in a running process.
This is intended to guide debugger and tool authors in reimplementing
the protocol.

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2025-04-21 20:18:24 +00:00
Pablo Galindo Salgado
d134bd272f
gh-130861: Add clarification to the perf docs on optimization levels (#131098) 2025-04-18 14:42:20 +01:00
Neil Schemenauer
c6973eea13
Add Doc section in free-threaded extension howto for critical sections (GH-132531) 2025-04-16 12:43:01 -07:00
Charles Machalow
517e96b9ed
gh-132106: Allow logging.handlers.QueueListener to be used as a context manager (#132107) 2025-04-12 12:00:04 +00:00
Jiayu Yi
5fbe23ee4e
Fix example code in curses tutorial (#126446) 2025-04-10 15:06:38 +03: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
stratakis
ecdf6b15b0
gh-118518: Minor improvements to perf docs (#130866)
Minor improvements to perf docs
2025-03-10 21:51:21 +00:00
Vinay Sajip
8cbcf51d61
[doc]: Update logging cookbook to mention domain socket configuration in a recipe. (GH-130348) 2025-02-20 14:09:15 +00:00
Serhiy Storchaka
078ab828b9
Use roles :data: and :const: for referencing module variables (GH-129507) 2025-02-04 16:16:41 +02:00
smelnikov
da310d209a
Docs: fix typo in Doc/howto/mro.rst (GH-129095) 2025-01-21 10:22:13 +01:00
Nathan Goldbaum
e7adeecc2b
gh-128426: Mention PySequence_Fast in free-threading C API HOWTO (#128428) 2025-01-03 13:10:24 +05:30
Alyssa Coghlan
831b6de6d7
gh-126180: Remove getopt and optparse deprecation notices (GH-126227)
* Remove getopt and optparse deprecation notices
* Add new docs sections for command line app helper libraries
* Add guidance on choosing a CLI parsing library to the optparse docs
* Link to the new guidance from the argparse and getopt docs
* Reword intro in docs section for superseded stdlib modules
* Reframe the optparse->argparse guide as a migration guide
  rather than as an upgrade guide

---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-12-23 14:17:19 +10:00
Maciej Olko
657d0e99aa
[Docs] GDB howto: Fix block type of a cast example (#127621) 2024-12-05 22:52:58 +02:00
Neil Schemenauer
fc5a0dc224
gh-127271: Replace use of PyCell_GET/SET (gh-127272)
* Replace uses of `PyCell_GET` and `PyCell_SET`.  These macros are not
  safe to use in the free-threaded build.  Use `PyCell_GetRef()` and
  `PyCell_SetTakeRef()` instead. 

* Since `PyCell_GetRef()` returns a strong rather than borrowed ref, some
  code restructuring was required, e.g. `frame_get_var()` returns a strong
  ref now.

* Add critical sections to `PyCell_GET` and `PyCell_SET`.

* Move critical_section.h earlier in the Python.h file.

* Add `PyCell_GET` to the free-threading howto table of APIs that return
  borrowed refs.

* Add additional unit tests for free-threading.
2024-12-03 10:33:06 -08:00
Alexander Stepchenko
8c3fd1f245
docs(logging): fix phrasing from "operation on" to "operate on" (#127543) 2024-12-03 12:22:12 +05:30
Yuki Kobayashi
733fe59206
gh-101100: Fix sphinx warnings in howto/* (#127084) 2024-11-26 10:17:54 +02:00
Gregory P. Smith
1fe67df8e3
gh-48020: [docs] Remove the logging howto suggested future FileHandler multiprocessing support (GH-126531)
Docs: Remove the logging howto potential promise of multiprocessing support in the future.

Stick to the facts and suggestions, don't provide hope where we're not going to
implement complexity that we'd rather the user implement themselves when
needed.
2024-11-07 01:57:01 -08:00
Savannah Ostrowski
dbcc5ac470
gh-95836: Add custom type converter examples to argparse tutorial (GH-125376) 2024-10-17 14:41:22 +03:00
Savannah Ostrowski
37228bd16e
GH-124478: Cleanup argparse documentation (#124877)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2024-10-08 15:07:29 -07:00
Jan Kaliszewski
9047146e54
gh-75898: make use of thread more explicit in the "Socket Programming HOWTO" document (#125023) 2024-10-08 17:43:37 +05:30
Raymond Hettinger
165ed68c26
Sorting techniques edits (#124701) 2024-09-27 17:19:44 -07:00
Sam Gross
68e384c217
gh-124370: Add "howto" for free-threaded Python (#124371)
* gh-124370: Add "howto" for free-threaded Python

This is a guide aimed at people writing Python code, as oppposed to the
existing guide for C API extension authors.

* Add missing new line

* Update Doc/howto/free-threading-python.rst

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

* interned -> immortalized

* Apply suggestions from code review

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

* Update Doc/howto/free-threading-python.rst

Co-authored-by: mpage <mpage@cs.stanford.edu>

* Update docs

* Apply suggestions from code review

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>

* A few more updates

* Additional comment on immortal objects

* Mention specializing adaptive interpreter

* Remove trailing whitespace

* Remove mention of C macro

---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: mpage <mpage@cs.stanford.edu>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-09-25 17:31:53 -04:00
Alex Waygood
0d9d56c4e4
gh-101100: Add a table of class attributes to the "Custom classes" section of the data model docs (#124480) 2024-09-25 19:29:58 +00:00
Raymond Hettinger
cd06f5e323
Minor edits to the descriptor guide (GH-123928) 2024-09-13 17:02:37 -05:00