Commit Graph

13540 Commits

Author SHA1 Message Date
Brian Schubert dc76a4ad3c
gh-126012: Add `__class_getitem__` to `memoryview` (#126013)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2024-10-27 13:36:03 +03:00
Zhikang Yan dad3453129
gh-125633: Add function `ispackage` to stdlib `inspect` (#125634)
---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2024-10-27 14:57:43 +10:00
Bénédikt Tran 417c130ba5
gh-120313: amend documentation regarding `ctypes._CFuncPtr` (GH-120989)
improve docs
2024-10-25 15:32:23 +02:00
Serhiy Storchaka da8673da36
gh-84545: Clarify the 'extend' action documentation in argparse (GH-125870) 2024-10-25 08:41:38 +00:00
Wulian 9c01db40aa
gh-125665: Update turtledemo docstrings with correct file names (#125691)
Co-authored-by: Wulian <xiguawulian@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-10-23 16:29:32 -04:00
Eric Snow 6f26d496d3
gh-125286: Share the Main Refchain With Legacy Interpreters (gh-125709)
They used to be shared, before 3.12.  Returning to sharing them resolves a failure on Py_TRACE_REFS builds.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-10-23 10:10:06 -06:00
Serhiy Storchaka 834ba5aaf2
gh-58032: Deprecate the argparse.FileType type converter (GH-124664) 2024-10-23 10:50:29 +03:00
Jacob Walls c75ff2ef8e
gh-80958: unittest: discovery support for namespace packages as start directory (#123820) 2024-10-23 13:41:33 +09:00
Serhiy Storchaka dcc4fb2c90
gh-124969: Make locale.nl_langinfo(locale.ALT_DIGITS) returning a string again (GH-125774)
This is a follow up of GH-124974. Only Glibc needed a fix.
Now the returned value is a string consisting of semicolon-separated
symbols on all Posix platforms.
2024-10-21 18:54:12 +00:00
Serhiy Storchaka 5ca4e34bc1
gh-125767: Fix pickling and copying of super objects (GH-125781)
Previously, copying a super object returned a copy of the instance
invoking super(). Pickling a super object could pickle the instance
invoking super() or fail, depending on its type and protocol.

Now deep copying returns a new super object and pickling pickles the super
object. Shallow copying returns the same super object.
2024-10-21 21:30:45 +03:00
ember91 ded105a62b
Doc: Fix typos (#125728) 2024-10-21 10:44:18 +02:00
RUANG (Roy James) 9256be7ff0
gh-99030: Added documentation links for types and exceptions (GH-123857)
* Added documentation links for types and exceptions

* Shortened description sentences

* Change content

* Change documentation

* Move seealso

* Add a spaces
2024-10-20 17:36:27 -07:00
Tom Most 14cafe1a10
Doc: Fix pluralization in os.process_cpu_count() documentation (#125678) 2024-10-20 01:48:06 +01:00
Sam Gross d8c8648161
gh-125541: Make Ctrl-C interrupt `threading.Lock.acquire()` on Windows (#125546) 2024-10-17 20:10:55 +02:00
chrysn b454662921
gh-118986: expose `socket.IPV6_RECVERR` (#118987) 2024-10-17 20:49:12 +03:00
Savannah Ostrowski 7b04496e5c
gh-125542: Deprecate prefix_chars in ArgumentParser.add_argument_group() (GH-125563) 2024-10-17 09:11:47 +00:00
Savannah Ostrowski 624be8699a
GH-99749: Add optional feature to suggest correct names (ArgumentParser) (GH-124456) 2024-10-17 10:07:37 +03:00
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
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
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
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
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
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
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
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
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
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
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
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