Commit Graph

28759 Commits

Author SHA1 Message Date
Eric Snow a5a7f5e16d
gh-124694: Add concurrent.futures.InterpreterPoolExecutor (gh-124548)
This is an implementation of InterpreterPoolExecutor that builds on ThreadPoolExecutor.

(Note that this is not tied to PEP 734, which is strictly about adding a new stdlib module.)

Possible future improvements:

* support passing a script for the initializer or to submit()
* support passing (most) arbitrary functions without pickling
* support passing closures
* optionally exec functions against __main__ instead of the their original module
2024-10-16 16:50:46 -06:00
Cornelius Roemer aab3210271
gh-125615: Fix grammar nit in tutorial's interactive interpreter appendix (GH-125617)
Replace "without ... nor" with "with neither ... nor"
2024-10-16 15:53:30 -05:00
Kirill Podoprigora bee112a94d
gh-124872: Replace enter/exit events with "switched" (#125532)
Users want to know when the current context switches to a different
context object.  Right now this happens when and only when a context
is entered or exited, so the enter and exit events are synonymous with
"switched".  However, if the changes proposed for gh-99633 are
implemented, the current context will also switch for reasons other
than context enter or exit.  Since users actually care about context
switches and not enter or exit, replace the enter and exit events with
a single switched event.

The former exit event was emitted just before exiting the context.
The new switched event is emitted after the context is exited to match
the semantics users expect of an event with a past-tense name.  If
users need the ability to clean up before the switch takes effect,
another event type can be added in the future.  It is not added here
because YAGNI.

I skipped 0 in the enum as a matter of practice.  Skipping 0 makes it
easier to troubleshoot when code forgets to set zeroed memory, and it
aligns with best practices for other tools (e.g.,
https://protobuf.dev/programming-guides/dos-donts/#unspecified-enum).

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-10-16 13:53:21 +02:00
Hugo van Kemenade 8cdaca8b25 Python 3.14.0a1 2024-10-15 22:34:54 +03:00
Savannah Ostrowski c9826c11db
gh-89819: Add argument_default and conflict_handler to add_argument_group() docs (GH-125379) 2024-10-15 15:48:28 +00:00
Kirill Podoprigora d3c82b9cce
gh-125512: Revert "gh-124872: Replace enter/exit events with "switched" (#124776)" (#125513) 2024-10-15 17:42:16 +03:00
sobolevn c8a1818fb0
gh-125517: Fix unreachable code warnings in `_testembed.c` (#125518) 2024-10-15 13:12:32 +00:00
RUANG (Roy James) 546dddca43
gh-125234: Make PyInitConfig_Free(NULL) a no-op (#125266) 2024-10-15 09:21:16 +00:00
Hugo van Kemenade 66064c342c
gh-123299: Copyedit "What's New in Python 3.14" (#125438) 2024-10-15 10:39:15 +03:00
Mariusz Felisiak a2fe9ff11d
Doc: Update CVE URL (#125489) 2024-10-15 10:29:08 +03:00
edson duarte 2a5cdb2516
gh-85453: Improve variable mark up for datetime.rst (#120702)
Variables and literals are marked up using backticks.
2024-10-15 00:02:58 +02:00
Richard Hansen 843d28f59d
gh-124872: Replace enter/exit events with "switched" (#124776)
Users want to know when the current context switches to a different
context object.  Right now this happens when and only when a context
is entered or exited, so the enter and exit events are synonymous with
"switched".  However, if the changes proposed for gh-99633 are
implemented, the current context will also switch for reasons other
than context enter or exit.  Since users actually care about context
switches and not enter or exit, replace the enter and exit events with
a single switched event.

The former exit event was emitted just before exiting the context.
The new switched event is emitted after the context is exited to match
the semantics users expect of an event with a past-tense name.  If
users need the ability to clean up before the switch takes effect,
another event type can be added in the future.  It is not added here
because YAGNI.

I skipped 0 in the enum as a matter of practice.  Skipping 0 makes it
easier to troubleshoot when code forgets to set zeroed memory, and it
aligns with best practices for other tools (e.g.,
https://protobuf.dev/programming-guides/dos-donts/#unspecified-enum).
2024-10-14 12:28:41 -07:00
Paul Hoffman 5dac0dceda
gh-125461: Remove Python 2 from identifiers in doc (GH-125462)
Remove Python 2 from identifiers in doc
2024-10-14 15:26:57 +00:00
Mikhail Efimov 45df264f3f
gh-112088: aclocal version is updated to 1.16.5 in docs (#125457) 2024-10-14 16:53:08 +02:00
Serhiy Storchaka 5217328f93
gh-121798: Add class method Decimal.from_number() (GH-121801)
It is an alternate constructor which only accepts a single numeric argument.
Unlike to Decimal.from_float() it accepts also Decimal.
Unlike to the standard constructor, it does not accept strings and tuples.
2024-10-14 08:24:01 +00:00
Serhiy Storchaka b52c7306ea
gh-121797: Add class method Fraction.from_number() (GH-121800)
It is an alternative constructor which only accepts a single numeric argument.
Unlike to Fraction.from_float() and Fraction.from_decimal() it accepts any
real numbers supported by the standard constructor (int, float, Decimal,
Rational numbers, objects with as_integer_ratio()).
Unlike to the standard constructor, it does not accept strings.
2024-10-14 07:54:59 +00:00
Sergey B Kirpichev cfc27bc50f
gh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-13 21:44:48 -07:00
Sergey B Kirpichev c6d7b644c2
gh-101291: Add versionadded directives for PyUnstable_Long_* (#125384) 2024-10-13 19:38:42 +02:00
partev 6c386b703d
gh-125403: fix console formatting in Chapter 12 of the tutorial (#125404) 2024-10-13 22:16:15 +05:30
Wulian 283ea5f3b2
gh-125383: Update `fib` function comment for accuracy (#125386)
`Doc/tutorial/controlflow.rst`: fix comment for `fib` function
2024-10-13 14:10:59 +03:00
Ruoyu Zhong a8fa4ad9e9
Doc: Fix suggested usage of `-X gil=0` in the glossary (#125366)
Currently, the "global interpreter lock" entry in the glossary mentions
that `-X gil 0` can be used to disable the GIL [1]. However, this is
invalid; the correct usage should be `-X gil=0`.

    $ python -X gil 0 -c 'print("Hello, world")'
    Fatal Python error: config_read_gil: PYTHON_GIL / -X gil must be "0" or "1"
    Python runtime state: preinitialized

    $ python -X gil=0 -c 'print("Hello, world")'
    Hello, world

[1]: https://docs.python.org/3/using/cmdline.html#cmdoption-X

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2024-10-13 01:53:28 +01:00
Richard Hansen 330c527299
gh-124872: Change PyContext_WatchCallback to take PyObject (#124737)
The PyContext struct is not intended to be public, and users of the
API don't need anything more specific than PyObject.  Also see
gh-78943.
2024-10-12 13:57:27 -07:00
Ghorban M. Tavakoly fa52b82c91
gh-125289: Update sample code in asyncio-task.rst (GH-125292)
* Update sample code in asyncio-task.rst

This will change **coroutines** sample code in the **Awaitables** section and make the example clearer.

* Update Doc/library/asyncio-task.rst

Revert the added print

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

* Update Doc/library/asyncio-task.rst

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

---------

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-12 13:38:13 -07:00
Stephen Rosen 4a2282b067
Prefer "similar" over "equivalent" in tutorial (#125343)
In the datastructures tutorial doc, some operations are described as
"equivalent to" others. This has led to some user-confusion -- at
least in the Discourse forums -- about cases in which the operations
differ.

This change doesn't systematically eliminate the word "equivalent"
from the tutorial. It just substitutes "similar to" in several cases
in which "equivalent to" could mislead users into expecting exact
equivalence.
2024-10-12 16:21:55 -04:00
Bernhard M. Wiedemann dcd58c5084
gh-125260: Change the default ``gzip.compress()`` mtime to 0 (#125261)
This follows GNU gzip, which defaults to using 0 as the mtime
for compressing stdin, where no file mtime is involved.

This makes the output of gzip.compress() deterministic by default,
greatly helping reproducible builds.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-12 18:18:48 +01:00
Serhiy Storchaka 07c2d15977
gh-85935: Explicitly document the case nargs=0 in argparse (GH-125302) 2024-10-12 11:53:00 +00:00
Serhiy Storchaka a6c0c64de0
gh-59330: Improve error message for dest= for positionals (GH-125215)
Also improve the documentation. Specify how dest and metavar are derived
from add_argument() positional arguments.

Co-authored-by: Simon Law <sfllaw@sfllaw.ca>
2024-10-12 14:46:28 +03:00
Rafael Fontenelle 5a074aab84
Doc: Fix a typo in "Function Examples" in the control-flow tutorial (#125338) 2024-10-12 01:40:33 +01:00
Victorien 21ac0a7f4c
gh-116938: Clarify documentation of `dict` and `dict.update` regarding the positional argument they accept (#125213)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-10-11 23:05:13 +00:00
Rafael Fontenelle 76b29d271b
Fix typo in ``Doclibrary/functions.rst`` (#125327) 2024-10-11 23:00:31 +03:00
Jan Kaliszewski 0135848059
gh-125058: update `_thread` docs regarding interruptibility of `lock.acquire()` (#125141) 2024-10-11 13:45:46 +05:30
Savannah Ostrowski c1913effee
gh-125296: Fix strange fragment identifier for `name or flags` in argparse docs (#125297) 2024-10-11 09:30:27 +03:00
Alex Waygood a726ce73ca
Add some doctest cleanups for `turtle` and `configparser` (#125288)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-10 23:53:45 +00:00
Adam Turner dd0ee201da
Doc: Upgrade Sphinx to 8.1 (#125276) 2024-10-10 21:26:01 +01:00
Justin Kunimune 3b87fb74c9
Note argparse exit code in documentation (GH-119568)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-10-10 20:56:05 +03:00
Irit Katriel f9ae5d1cee
gh-71784: [doc] add usage examples for traceback.TracebackException (#125189)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-10-10 11:21:12 +01:00
Richard Hansen 99400930ac
gh-124872: Refine contextvars documentation (#124773)
* Add definitions for "context", "current context", and "context
    management protocol".
  * Update related definitions to be consistent with the new
    definitions.
  * Restructure the documentation for the `contextvars.Context` class
    to prepare for adding context manager support, and for consistency
    with the definitions.
  * Use `testcode` and `testoutput` to test the `Context.run` example.
  * Expand the documentation for the `Py_CONTEXT_EVENT_ENTER` and
    `Py_CONTEXT_EVENT_EXIT` events to clarify and to prepare for
    planned changes.
2024-10-09 16:44:03 -07:00
Victor Stinner 1b2a5485f9
gh-125196: PyUnicodeWriter_Discard(NULL) does nothing (#125222) 2024-10-09 23:32:02 +00:00
Adam Turner cbfd392479
GH-121970: Extract ``availability`` into a new extension (#125082) 2024-10-09 21:50:03 +01:00
Victor Stinner b9a8ca0a6a
gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125194)
Replace PyUnicode_New(0, 0), PyUnicode_FromString("")
and PyUnicode_FromStringAndSize("", 0)
with Py_GetConstant(Py_CONSTANT_EMPTY_STR).
2024-10-09 17:15:23 +02:00
Hugo van Kemenade a5716a3091
gh-101100: Fix Sphinx warnings in `library/unittest.mock.rst` (#124106) 2024-10-09 17:02:18 +03:00
JamesMcCarthy21 e0835aff2e
gh-125168: Fix typo in `__future__.rst` (#125183)
* Update `__future__.rst`

Fixed typo in the sentence :pep:`649`: *Deferred evaluation of annotations using descriptors* - James McCarthy

* Update `__future__.rst`

Fixed sphinx formatting
2024-10-09 16:17:18 +03:00
Alex Waygood 3024b16d51
gh-101100: Consolidate documentation on `ModuleType` attributes (#124709)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Barry Warsaw <barry@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-10-09 10:53:57 +00:00
Alyssa Coghlan 7a303fc78a
Fix importlib.resources issue reference in 3.13 What's New (#125175)
Previous link was to the PR that removed the
mentioned importlib.resources APIs, rather than
the issue that added back their improved forms.
2024-10-09 20:40:50 +10:00
Serhiy Storchaka 21c04e1a97
gh-124969: Fix locale.nl_langinfo(locale.ALT_DIGITS) (GH-124974)
Now it returns a tuple of up to 100 strings (an empty tuple on most locales).
Previously it returned the first item of that tuple or an empty string.
2024-10-09 11:42:08 +03:00
musvaage 7f93dbf6fe
docs: in venv table use executable name (GH-124315)
Co-authored-by: musvaage <musvaage@users.noreply.github.com>
2024-10-09 09:04:35 +01:00
Jelle Zijlstra 78406382c9
gh-101552: Allow pydoc to display signatures in source format (#124669)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-10-09 05:03:53 +00: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
Raymond Hettinger b2a7272408
Misc improvements to the itertools docs (gh-125147) 2024-10-08 14:02:58 -05:00
spacemanspiff2007 760b1e103a
gh-124832: Add a note to indicate that `datetime.now` may return the same instant (#124834)
* Update datetime.rst

* Update datetime.rst

replace warning with note

* Update Doc/library/datetime.rst

Co-authored-by: Victor Stinner <vstinner@python.org>

* Update Doc/library/datetime.rst

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

---------

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-08 11:17:53 -07:00
monkeyman192 5967dd8a4d
gh-112433 add versionadded for `ctypes.Structure._align_` (#125087)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-10-08 12:41:46 +00:00
Kirill Podoprigora e8773e59a8
Doc: Improve description of ``GET_LEN`` opcode (#114583) 2024-10-08 17:55:40 +05:30
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
Alyssa Coghlan 7c4b6a68f2
bpo-34206: Improve docs and test coverage for pre-init functions (#8023)
- move the Py_Main documentation from the very high level API section
  to the initialization and finalization section
- make it clear that it encapsulates a full Py_Initialize/Finalize
  cycle of its own
- point out that exactly which settings will be read and applied
  correctly when Py_Main is called after a separate runtime
  initialization call is version dependent
- be explicit that Py_IsInitialized can be called prior to
  initialization
- actually test that Py_IsInitialized can be called prior to
  initialization
- flush stdout in the embedding tests that run code so it appears
  in the expected order when running with "-vv"
- make "-vv" on the subinterpreter embedding tests less spammy

---------

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-08 08:34:11 +00:00
Serhiy Storchaka 93b9e6bd7d
gh-69998: Fix decoding error in locale.nl_langinfo() (GH-124963)
The function now sets temporarily the LC_CTYPE locale to the locale
of the category that determines the requested value if the locales are
different and the resulting string is non-ASCII.
This temporary change affects other threads.
2024-10-08 11:27:49 +03:00
Alyssa Coghlan 27390990fa
gh-70870: Clarify dual usage of 'free variable' (#122545)
The term "free variable" has unfortunately become genuinely
ambiguous over the years (presumably due to the names of
some relevant code object instance attributes).

While we can't eliminate that ambiguity at this late date, we can
at least alert people to the potential ambiguity by describing
both the formal meaning of the term and the common
alternative use as a direct synonym for "closure variable".

---------

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-08 07:52:12 +00:00
Ned Batchelder 6e3c70c61b
Docs: make a tutorial example more precise (#125066)
Based on discussion here:

https://discuss.python.org/t/omission-in-the-documentation/66816
2024-10-07 19:41:13 -04:00
Emily Morehouse 447a15190d
gh-125072: Add label for assignment expressions; update tracked section for assignment expression topic (#125074) 2024-10-07 22:51:14 +00:00
Victor Stinner a7f0727ca5
gh-124502: Add PyUnicode_Equal() function (#124504) 2024-10-07 21:24:53 +00:00
Bénédikt Tran 7ffe94fb24
gh-124653: Relax (again) detection of queue API for logging handlers (GH-124897) 2024-10-07 19:42:19 +01:00
ffelixg 3287c834e5
gh-124182: Explain naming rules for struct sequence types (#124335) 2024-10-07 19:52:34 +02:00
Adam Turner 10094a533a
gh-125018: Fix role syntax (#125050) 2024-10-07 17:51:53 +01:00
Alyssa Coghlan cda3b5a576
gh-125018: Add importlib.metadata semantic link targets (#125027)
This allows direct intersphinx references to APIs via references
like `` :func:`importlib.metadata.version` ``.

---------

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-10-07 23:44:18 +10:00
Sergey B Kirpichev 7487db4c7a
gh-121249: Support _Complex types in the struct module (#121613)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-10-07 13:53:02 +02:00
Adam Turner 31516c98dd
GH-109975: Announce final release in What's New in Python 3.13 (#125007)
Prepare What's New in Python 3.13 for final release
2024-10-06 21:43:03 -07:00
Jan Kaliszewski 1e098dc766
gh-125025: `_thread` docs: fix/update the *caveats* list (GH-125026) 2024-10-06 15:57:03 -07:00
Andrés Delfino feca4cf64e
Doc: Simplify the definition of 'soft deprecated' (#124988)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-06 22:22:19 +00:00
Nice Zombies bd393aedb8
Fix console prompt syntax in What's New in Python 3.8 (#124968) 2024-10-04 12:33:54 +01:00
Christian Clauss ac9648243d
gh-109975: Suggest ``pynntp`` instead of ``nntplib`` (#124830)
The ``nntplib`` library has been deleted from PyPI by its author.
2024-10-04 11:21:03 +01:00
Adam Turner c8db0e817e
GH-109975: Copyedit 3.13 What's New: Remove references to the incremental GC (#124947) 2024-10-03 21:06:29 +01:00
Raymond Hettinger 7ecaf21946
Simplify partial() rough equivalent code (gh-124941) 2024-10-03 19:54:53 +00:00
Donghee Na 9eeb21bf76
gh-115145: Update documentation about ``PyThreadState_DeleteCurrent`` (gh-124920) 2024-10-03 19:34:47 +09:00
Jeremy Maitin-Shepard 8cc5aa47ee
gh-87135: Hang non-main threads that attempt to acquire the GIL during finalization (GH-105805)
Instead of surprise crashes and memory corruption, we now hang threads that attempt to re-enter the Python interpreter after Python runtime finalization has started. These are typically daemon threads (our long standing mis-feature) but could also be threads spawned by extension modules that then try to call into Python. This marks the `PyThread_exit_thread` public C API as deprecated as there is no plausible safe way to accomplish that on any supported platform in the face of things like C++ code with finalizers anywhere on a thread's stack. Doing this was the least bad option.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-10-02 09:17:49 -07:00
Serhiy Storchaka 04bfea2d26
gh-66436: Improved prog default value for argparse.ArgumentParser (GH-124799)
It can now have one of three forms:

* basename(argv0) -- for simple scripts
* python arv0 -- for directories, ZIP files, etc
* python -m module -- for imported modules

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-10-01 22:51:40 +03:00
Gregory P. Smith d150e4abcf
Highlight `datetime.timedelta.seconds` vs `.total_seconds()` in docs. (GH-124811)
Thanks to the reviewers for suggesting the use of a "caution" section instead of "warning" or "note".
2024-10-01 18:10:13 +00:00
Tian Gao 5e0abb4788
gh-116750: Add clear_tool_id function to unregister events and callbacks (#124568) 2024-10-01 13:32:55 -04:00
Wulian da1e5526ae
gh-124487: Updated installer messages and internal docs regarding minimum Windows version (GH-124822) 2024-10-01 15:44:18 +01:00
Victorien 3e3a4d2315
gh-118974: Add `decorator` argument to `make_dataclass` (gh-122723)
This is to allow the `dataclasses.make_dataclass` infrastructure to be used with another decorator that's compliant with `typing.dataclass_transform`. The new `decorator` argument to `dataclasses.make_dataclass` is `dataclasses.dataclass`, which used to be hard coded.
2024-10-01 09:51:51 -04:00
Adam Turner 91e64be731
Doc: Fix archive filenames for standard builds (#124826) 2024-10-01 10:43:55 +01:00
Adam Turner 4129a74a37
GH-109975: Copyedit 3.13 What's New: Link to installing free-threaded binaries on macOS (#124831) 2024-10-01 08:27:59 +00:00
Adam Turner 8823690264
GH-109975: Copyedit 3.13 What's New: Note delayed expected release date for Python 3.13.0 (GH-124827)
Note delayed expected release date of 3.13.0
2024-10-01 07:18:59 +00:00
Adam Turner cce1125574
Doc: Run HTML and non-HTML daily builds separately (#124493) 2024-09-30 17:48:12 +01:00
Tian Gao b5774603a0
gh-124400: Use the normal command path for breakpoint commands (#124401)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-09-29 19:46:16 -04:00
Ned Deily 4b83c03ce9
gh-124720: Update "Using Python on a Mac" document (#124721)
Update "Using Python on a Mac" section of the "Python Setup and Usage"
document and include information on installing free-threading support.
2024-09-30 07:39:46 +08:00
CBerJun 76fbee642e
Docs: improve generic `typing.NamedTuple` example (#124739) 2024-09-29 12:07:05 +01:00
Serhiy Storchaka f1a2417b9e
gh-61181: Fix support of choices with string value in argparse (GH-124578)
Substrings of the specified string no longer considered valid values.
2024-09-29 10:57:21 +03:00
Serhiy Storchaka 69a4063ca5
gh-123339: Fix cases of inconsistency of __module__ and __firstlineno__ in classes (GH-123613)
* Setting the __module__ attribute for a class now removes the
  __firstlineno__ item from the type's dict.
* The _collections_abc and _pydecimal modules now completely replace the
  collections.abc and decimal modules after importing them. This
  allows to get the source of classes and functions defined in these
  modules.
* inspect.findsource() now checks whether the first line number for a
  class is out of bound.
2024-09-28 20:51:49 +03:00
Jelle Zijlstra c976d789a9
docs: improve venv docs (#124540)
- Move "versionchanged" notes that apply to the whole class to the
  end of the class docs
- Remove or move notes next to the method list that apply to individual
  methods.
- Mark up parameters using the appropriate syntax
- Do not capitalize "boolean"
- Shorten some text
2024-09-28 05:50:09 -07:00
Jean-François B. fae5058ec1
Doc: Fix default ``latex_elements['papersize']`` (#124525)
https://www.sphinx-doc.org/en/master/latex.html#the-latex-elements-configuration-setting

It should be 'letterpaper' or 'a4paper' not 'letter' or 'a4'
(not to be confused with PAPER env variable).
2024-09-28 11:30:28 +01:00
Raymond Hettinger 165ed68c26
Sorting techniques edits (#124701) 2024-09-27 17:19:44 -07:00
Pablo Galindo Salgado 02b49c5150
gh-107954: Fix configuration type for the perf profiler (#124636) 2024-09-28 01:50:16 +02:00
Petr Viktorin 425587a110
gh-124385: Document and soft-deprecate PyLong_AS_LONG (GH-124386) 2024-09-27 23:40:50 +00:00
Jelle Zijlstra 1ba35ea385
gh-123299: Copy-edit the 3.14 What's New (#124670)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-09-28 01:25:33 +03:00
Matt Delengowski 2357d5ba48
gh-90190: Add doc for using `singledispatch` with precise collection type hints (#116544) 2024-09-27 21:10:29 +00:00
Emily Morehouse 626668912f
gh-81263: Add assignment expressions to `help` (#124641)
* Add assignment expression (:=) to `help`

* Update index for Assignment Expressions to include pair of `assignment; expression`
2024-09-27 13:59:26 -07:00
Petr Viktorin 3387f76b8f
gh-124520: What's New entry for ctypes metaclass __new__/__init__ change (GH-124546) 2024-09-27 22:13:53 +02:00
Victor Stinner d8cf587dc7
doc: PyUnicode_AsUTF8String() fails if string contains surrogates (#124605) 2024-09-27 20:13:29 +00:00
Raymond Hettinger 2e155536ca
Itertool docs: Minor clarifications, wording tweaks, spacing, and active voice. (gh-124690)
Minor clarifications, wording tweaks, spacing, and active voice.
2024-09-27 18:43:46 +00:00
Petr Viktorin e349f73a5a
gh-121277: Raise nice error on `next` as second argument to deprecated-removed (GH-124623) 2024-09-27 19:38:40 +02:00
Alex Waygood 6716dd1c33
Fixup indentation for docs on `ModuleSpec` attributes (#124681)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-09-27 17:35:09 +00:00