]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agoGH-100805: Support numpy.array() in random.choice(). (GH-100830)
Raymond Hettinger [Sun, 8 Jan 2023 19:40:35 +0000 (13:40 -0600)] 
GH-100805:  Support numpy.array() in random.choice(). (GH-100830)

2 years agogh-100833: Remove 'volatile' qualifiers in fsum algorithm (#100845)
Mark Dickinson [Sun, 8 Jan 2023 19:40:15 +0000 (19:40 +0000)] 
gh-100833: Remove 'volatile' qualifiers in fsum algorithm (#100845)

This PR removes the `volatile` qualifier on various intermediate quantities
in the `math.fsum` implementation, and updates the notes preceding the
algorithm accordingly (as well as fixing some of the exsting notes). See
the linked issue #100833 for discussion.

2 years agoGH-100485: Tweaks to sumprod() (GH-100857)
Raymond Hettinger [Sun, 8 Jan 2023 19:38:24 +0000 (13:38 -0600)] 
GH-100485: Tweaks to sumprod() (GH-100857)

2 years agoUpdate copyright years to 2023. (gh-100848)
Benjamin Peterson [Sun, 8 Jan 2023 15:13:25 +0000 (09:13 -0600)] 
Update copyright years to 2023. (gh-100848)

2 years agoGH-90829: Fix empty iterable error message in min/max (#31181)
Nnarol [Sun, 8 Jan 2023 13:51:20 +0000 (14:51 +0100)] 
GH-90829: Fix empty iterable error message in min/max (#31181)

2 years agogh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory...
Nikita Sobolev [Sun, 8 Jan 2023 12:54:40 +0000 (15:54 +0300)] 
gh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (GH-24061)" (#100745)

* gh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (GH-24061)"

This reverts commit 7c83eaa536d2f436ae46211ca48692f576c732f0.

2 years agogh-100783: fix os.path.join documentation (#100811)
Shantanu [Sun, 8 Jan 2023 08:51:30 +0000 (00:51 -0800)] 
gh-100783: fix os.path.join documentation (#100811)

- Use "drive", not "drive letter", because of UNC paths
- Previous components are not thrown away from relative drive letters
- Use "segment" instead of "component" for consistency with pathlib
- Other miscellaneous improvements

2 years agogh-91851: Micro optimizations for arithmetic between Fractions (#25518)
Sergey B Kirpichev [Sun, 8 Jan 2023 08:34:20 +0000 (11:34 +0300)] 
gh-91851: Micro optimizations for arithmetic between Fractions (#25518)

Adapted from
https://github.com/python/cpython/pull/24779/commits/046c84e8f9

This makes arithmetic between Fractions with small components
just as fast as before python/cpython#24779, at some expense of
mixed arithmetic (e.g. Fraction + int).

2 years agogh-100824: Fix typo in the documentation of unittest.TestLoader.testNamePatterns...
busywhitespace [Sun, 8 Jan 2023 08:07:16 +0000 (09:07 +0100)] 
gh-100824: Fix typo in the documentation of unittest.TestLoader.testNamePatterns (#100825)

2 years agogh-100776: Fix misleading default value in help(input) (#100788)
Shantanu [Sun, 8 Jan 2023 07:57:41 +0000 (23:57 -0800)] 
gh-100776: Fix misleading default value in help(input) (#100788)

2 years agoGH-100485: Convert from Fast2Sum to 2Sum (GH-100836)
Raymond Hettinger [Sun, 8 Jan 2023 03:37:08 +0000 (21:37 -0600)] 
GH-100485: Convert from Fast2Sum to 2Sum (GH-100836)

2 years agogh-100815: Normalize `types` module usage in `copy` module (#100816)
Nikita Sobolev [Sat, 7 Jan 2023 21:29:53 +0000 (00:29 +0300)] 
gh-100815: Normalize `types` module usage in `copy` module (#100816)

2 years agogh-100792: Make `email.message.Message.__contains__` twice as fast (#100793)
Nikita Sobolev [Sat, 7 Jan 2023 21:26:05 +0000 (00:26 +0300)] 
gh-100792: Make `email.message.Message.__contains__` twice as fast (#100793)

2 years agoGH-100485: Add math.sumprod() (GH-100677)
Raymond Hettinger [Sat, 7 Jan 2023 18:46:35 +0000 (12:46 -0600)] 
GH-100485:  Add math.sumprod() (GH-100677)

2 years agogh-100673: Removed erroneous note in the get_type_hints docs (#100701)
FrozenBob [Sat, 7 Jan 2023 17:31:47 +0000 (09:31 -0800)] 
gh-100673: Removed erroneous note in the get_type_hints docs (#100701)

Removed erroneous note in the get_type_hints docs

typing.get_type_hints still includes base class type hints.

2 years agogh-88696: clean up dead argument to compiler_make_closure (GH-100806)
Carl Meyer [Sat, 7 Jan 2023 12:20:48 +0000 (05:20 -0700)] 
gh-88696: clean up dead argument to compiler_make_closure (GH-100806)

2 years agogh-96127: Fix `inspect.signature` call on mocks (#96335)
Nikita Sobolev [Sat, 7 Jan 2023 10:49:15 +0000 (13:49 +0300)] 
gh-96127: Fix `inspect.signature` call on mocks (#96335)

2 years agogh-100690: [mock] hide `ATTRIB_DENY_LIST` and make it immutable (#100819)
Nikita Sobolev [Sat, 7 Jan 2023 10:25:05 +0000 (13:25 +0300)] 
gh-100690: [mock] hide `ATTRIB_DENY_LIST` and make it immutable (#100819)

2 years agoAdd barneygale to CODEOWNERS for pathlib (#100808)
Barney Gale [Fri, 6 Jan 2023 20:38:12 +0000 (20:38 +0000)] 
Add barneygale to CODEOWNERS for pathlib (#100808)

2 years agogh-100690: Raise an AttributeError when the assert_ prefix is forgotten when using...
Christian Klein [Fri, 6 Jan 2023 18:38:50 +0000 (19:38 +0100)] 
gh-100690: Raise an AttributeError when the assert_ prefix is forgotten when using Mock (#100691)

Mock objects which are not unsafe will now raise an AttributeError when accessing an
attribute that matches the name of an assertion but without the prefix `assert_`, e.g. accessing `called_once` instead of `assert_called_once`.

This is in addition to this already happening for accessing attributes with prefixes assert, assret, asert, aseert, and assrt.

2 years agoGH-98831: Add some tests for generate_cases.py (#100763)
Guido van Rossum [Fri, 6 Jan 2023 16:04:20 +0000 (08:04 -0800)] 
GH-98831: Add some tests for generate_cases.py (#100763)

- This doesn't cover everything (far from it) but it's a start.
- This uses pytest, which isn't ideal, but was quickest to get started.

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agogh-91851: Trivial optimizations in Fraction (#100791)
Sergey B Kirpichev [Fri, 6 Jan 2023 15:37:34 +0000 (18:37 +0300)] 
gh-91851: Trivial optimizations in Fraction (#100791)

Make some trivial performance optimizations in Fraction

Uses private class attributes `_numerator` and `_denominator` in place of the `numerator` and `denominator` property accesses.

Co-authored-by: hauntsaninja <hauntsaninja@gmail.com>
2 years agogh-100758: Refactor initialisation of frame headers into a single function (_PyFrame_...
Irit Katriel [Fri, 6 Jan 2023 14:55:56 +0000 (14:55 +0000)] 
gh-100758: Refactor initialisation of frame headers into a single function (_PyFrame_Initialize) (GH-100759)

2 years agoGH-99005: More intrinsics (GH-100774)
Mark Shannon [Fri, 6 Jan 2023 14:47:57 +0000 (14:47 +0000)] 
GH-99005: More intrinsics (GH-100774)

* Remove UNARY_POSITIVE, LIST_TO_TUPLE and ASYNC_GEN_WRAP, replacing them with intrinsics.

2 years agogh-99026 update dataclasses docs for when annotations are inspected (gh-100798)
Akshit Tyagi [Fri, 6 Jan 2023 14:26:44 +0000 (19:56 +0530)] 
gh-99026 update dataclasses docs for when annotations are inspected (gh-100798)

update dataclasses docs for when annotations are inspected

2 years agogh-87691: clarify use of anchor in pathlib docs (#100782)
Shantanu [Fri, 6 Jan 2023 01:49:33 +0000 (17:49 -0800)] 
gh-87691: clarify use of anchor in pathlib docs (#100782)

This is feedback from https://github.com/python/cpython/pull/100737#discussion_r1062968696

This matches the wording from the `os.path.join` docs better:
https://docs.python.org/3/library/os.path.html#os.path.join

In particular, the previous use of "anchor" was incorrect given the
pathlib definition of "anchor".

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2 years agogh-90104: avoid RecursionError on recursive dataclass field repr (gh-100756)
Carl Meyer [Fri, 6 Jan 2023 00:19:40 +0000 (17:19 -0700)] 
gh-90104: avoid RecursionError on recursive dataclass field repr (gh-100756)

Avoid RecursionError on recursive dataclass field repr

2 years agogh-86082: bpo-41916: allow cross-compiled python to have -pthread set for CXX (#22525)
Dustin Spicuzza [Thu, 5 Jan 2023 22:57:31 +0000 (17:57 -0500)] 
gh-86082: bpo-41916: allow cross-compiled python to have -pthread set for CXX (#22525)

When cross-compiling, the compile/run test for -pthread always fails so -pthread
will never be automatically set without an override from the cache. ac_cv_pthread
can already be overridden, so do the same thing for ac_cv_cxx_thread.

2 years agogh-87691: add an absolute path pathlib example in / operator docs (GH-100737)
Shantanu [Thu, 5 Jan 2023 22:55:35 +0000 (14:55 -0800)] 
gh-87691: add an absolute path pathlib example in / operator docs (GH-100737)

The behaviour is fully explained a couple paragraphs above, but it may be useful to have a brief example to cover the behaviour.

Automerge-Triggered-By: GH:hauntsaninja
2 years agoAdd hauntsaninja as tomllib CODEOWNER (#100779)
Shantanu [Thu, 5 Jan 2023 22:28:02 +0000 (14:28 -0800)] 
Add hauntsaninja as tomllib CODEOWNER (#100779)

2 years agogh-100562: improve performance of `pathlib.Path.absolute()` (GH-100563)
Barney Gale [Thu, 5 Jan 2023 22:11:50 +0000 (22:11 +0000)] 
gh-100562: improve performance of `pathlib.Path.absolute()` (GH-100563)

Increase performance of the `absolute()` method by calling `os.getcwd()` directly, rather than using the `Path.cwd()` class method. This avoids constructing an extra `Path` object (and the parsing/normalization that comes with it).

Decrease performance of the `cwd()` class method by calling the `Path.absolute()` method, rather than using `os.getcwd()` directly. This involves constructing an extra `Path` object. We do this to maintain a longstanding pattern where `os` functions are called from only one place, which allows them to be more readily replaced by users. As `cwd()` is generally called at most once within user programs, it's a good bargain.

```shell
# before
$ ./python -m timeit -s 'from pathlib import Path; p = Path("foo", "bar")' 'p.absolute()'
50000 loops, best of 5: 9.04 usec per loop
# after
$ ./python -m timeit -s 'from pathlib import Path; p = Path("foo", "bar")' 'p.absolute()'
50000 loops, best of 5: 5.02 usec per loop
```

Automerge-Triggered-By: GH:AlexWaygood
2 years agogh-98831: Regenerate Python/opcode_metadata.h (GH-100778)
Zachary Ware [Thu, 5 Jan 2023 21:47:18 +0000 (15:47 -0600)] 
gh-98831: Regenerate Python/opcode_metadata.h (GH-100778)

2 years agoGH-98831: Update generate_cases.py: register inst, opcode_metadata.h (#100735)
Guido van Rossum [Thu, 5 Jan 2023 21:01:07 +0000 (13:01 -0800)] 
GH-98831: Update generate_cases.py: register inst, opcode_metadata.h (#100735)

(These aren't used yet, but may be coming soon,
and it's easier to keep this tool the same between branches.)

Added a sanity check for all this to compile.c.

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2 years agoGH-99005: Add `CALL_INTRINSIC_1` instruction (GH-100771)
Mark Shannon [Thu, 5 Jan 2023 16:05:51 +0000 (16:05 +0000)] 
GH-99005: Add `CALL_INTRINSIC_1` instruction (GH-100771)

* Remove PRINT_EXPR instruction

* Remove STOPITERATION_ERROR instruction

* Remove IMPORT_STAR instruction

2 years agoGH-100288: Remove LOAD_ATTR_METHOD_WITH_DICT instruction. (GH-100753)
Mark Shannon [Thu, 5 Jan 2023 12:20:09 +0000 (12:20 +0000)] 
GH-100288: Remove LOAD_ATTR_METHOD_WITH_DICT instruction. (GH-100753)

2 years agoGH-100766: Note that locale.LC_MESSAGES is not universal (GH-100702)
Tzu-ping Chung [Thu, 5 Jan 2023 03:34:30 +0000 (11:34 +0800)] 
GH-100766: Note that locale.LC_MESSAGES is not universal (GH-100702)

2 years agoDrop myself from pathlib maintenance (#100757)
Brett Cannon [Wed, 4 Jan 2023 22:59:48 +0000 (14:59 -0800)] 
Drop myself from pathlib maintenance (#100757)

2 years agogh-100739: Respect mock spec when checking for unsafe prefixes (#100740)
Christian Klein [Wed, 4 Jan 2023 22:31:29 +0000 (23:31 +0100)] 
gh-100739: Respect mock spec when checking for unsafe prefixes (#100740)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years agogh-100747: some compiler macros use c instead of C to access the compiler (#100748)
Irit Katriel [Wed, 4 Jan 2023 20:19:20 +0000 (20:19 +0000)] 
gh-100747: some compiler macros use c instead of C to access the compiler (#100748)

2 years agoGH-100719: Remove the `co_nplaincellvars` field from code objects. (GH-100721)
Mark Shannon [Wed, 4 Jan 2023 15:41:39 +0000 (15:41 +0000)] 
GH-100719: Remove the `co_nplaincellvars` field from code objects. (GH-100721)

2 years agogh-100720: refactor calculation of number of frame slots for a code object into the...
Irit Katriel [Wed, 4 Jan 2023 13:37:06 +0000 (13:37 +0000)] 
gh-100720: refactor calculation of number of frame slots for a code object into the new function _PyFrame_NumSlotsForCodeObject (#100722)

2 years agodocs: fix `ssizeobjargproc` parameters (#100736)
David Lechner [Wed, 4 Jan 2023 08:17:42 +0000 (02:17 -0600)] 
docs: fix `ssizeobjargproc` parameters (#100736)

2 years agoGH-86508: skip binding to local addresses of different family in `asyncio.open_connec...
Kumar Aditya [Wed, 4 Jan 2023 08:00:26 +0000 (13:30 +0530)] 
GH-86508: skip binding to local addresses of different family in `asyncio.open_connection` (#100615)

2 years agogh-91219: http - use subclassing to override index_pages attribute (GH-100731)
Ethan Furman [Tue, 3 Jan 2023 23:20:08 +0000 (15:20 -0800)] 
gh-91219: http - use subclassing to override index_pages attribute (GH-100731)

Remove previously added parameter to `__init__`, and recommend subclassing to modify the `index_pages` attribute instead.

2 years ago[Enum] docs: replace 'last value' by 'highest value' for Flag auto (GH-100709)
Christophe Nanteuil [Tue, 3 Jan 2023 22:08:50 +0000 (23:08 +0100)] 
[Enum] docs: replace 'last value' by 'highest value' for Flag auto  (GH-100709)

2 years agogh-100700: Remove Date and Release fields in past whatsnews (GH-100728)
Zachary Ware [Tue, 3 Jan 2023 22:00:26 +0000 (16:00 -0600)] 
gh-100700: Remove Date and Release fields in past whatsnews (GH-100728)

2 years agogh-100146: Steal references from stack when building a list (#100147)
L. A. F. Pereira [Tue, 3 Jan 2023 18:49:49 +0000 (10:49 -0800)] 
gh-100146: Steal references from stack when building a list (#100147)

When executing the BUILD_LIST opcode, steal the references from the stack,
in a manner similar to the BUILD_TUPLE opcode.  Implement this by offloading
the logic to a new private API, _PyList_FromArraySteal(), that works similarly
to _PyTuple_FromArraySteal().

This way, instead of performing multiple stack pointer adjustments while the
list is being initialized, the stack is adjusted only once and a fast memory
copy operation is performed in one fell swoop.

2 years agogh-95882: fix regression in the traceback of exceptions propagated from inside a...
Thomas Grainger [Tue, 3 Jan 2023 15:47:13 +0000 (15:47 +0000)] 
gh-95882: fix regression in the traceback of exceptions propagated from inside a contextlib context manager (#95883)

2 years agogh-89419: gdb: fix bug causing `AttributeError` in py-locals when no frame is availab...
Eli Schwartz [Tue, 3 Jan 2023 14:56:57 +0000 (09:56 -0500)] 
gh-89419: gdb: fix bug causing `AttributeError` in py-locals when no frame is available (#100611)

2 years agogh-81611: Improve `range` paragraph in 8.3 of language reference (#98353)
4l4k4z4m [Tue, 3 Jan 2023 08:16:51 +0000 (10:16 +0200)] 
gh-81611: Improve `range` paragraph in 8.3 of language reference (#98353)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2 years agogh-89727: Improve os.walk complexity (#100671)
Stanislav Zmiev [Mon, 2 Jan 2023 21:41:19 +0000 (01:41 +0400)] 
gh-89727: Improve os.walk complexity (#100671)

2 years agogh-100637: Fix int and bool __sizeof__ calculation to include the 1 element ob_digit...
Ionite [Mon, 2 Jan 2023 21:11:49 +0000 (05:11 +0800)] 
gh-100637: Fix int and bool __sizeof__ calculation to include the 1 element ob_digit array for 0 and False (#100663)

Fixes behaviour where int (and subtypes like bool) __sizeof__ under-reports true size as it did not take into account the size 1 `ob_digit` array for the zero int.

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2 years agogh-100676: Improve description for venv --upgrade-deps (GH-100678)
Rupa Lahiri [Mon, 2 Jan 2023 12:17:58 +0000 (17:47 +0530)] 
gh-100676: Improve description for venv --upgrade-deps (GH-100678)

2 years agofix `grammer` -> `grammar` typo in expressions.rst (GH-100683)
Kumar Aditya [Mon, 2 Jan 2023 11:49:06 +0000 (17:19 +0530)] 
fix `grammer` -> `grammar` typo in expressions.rst (GH-100683)

Automerge-Triggered-By: GH:AlexWaygood
2 years agoFix deprecation doc for `PyEval_InitThreads` (#100667)
Alexander Shadchin [Mon, 2 Jan 2023 11:13:55 +0000 (14:13 +0300)] 
Fix deprecation doc for `PyEval_InitThreads` (#100667)

2 years agogh-100428: Make int documentation more accurate (#100436)
Shantanu [Mon, 2 Jan 2023 03:14:18 +0000 (20:14 -0700)] 
gh-100428: Make int documentation more accurate (#100436)

- Remove first link to lexical definition of integer literal, since it
  doesn't apply (differs in handling of leading zeros, base needs to be
  explicitly specified, unicode digits are allowed)
- Better describe handling of leading zeros, unicode digits, underscores
- Base 0 does not work exactly as like a code literal, since it allows
  Unicode digits. Link code literal to lexical definition of integer
  literal.

2 years agogh-99953: Purge mention of numeric param style from sqlite3 docs (#100630)
Erlend E. Aasland [Sun, 1 Jan 2023 22:26:23 +0000 (23:26 +0100)] 
gh-99953: Purge mention of numeric param style from sqlite3 docs (#100630)

The PEP-249 numeric style has never been supported by sqlite3.

2 years agobuild(deps): bump actions/stale from 6 to 7 (#100656)
dependabot[bot] [Sun, 1 Jan 2023 21:49:10 +0000 (23:49 +0200)] 
build(deps): bump actions/stale from 6 to 7 (#100656)

2 years agogh-97930: Apply changes from importlib_resources 5.10. (GH-100598)
Jason R. Coombs [Sun, 1 Jan 2023 16:07:32 +0000 (11:07 -0500)] 
gh-97930: Apply changes from importlib_resources 5.10. (GH-100598)

2 years agogh-87980: Fix the error message for disallowed __weakref__ slots (#25362)
Géry Ogam [Sun, 1 Jan 2023 15:41:33 +0000 (16:41 +0100)] 
gh-87980: Fix the error message for disallowed __weakref__ slots (#25362)

Fix the error message for disallowed `__weakref__` slots.

2 years agogh-100201: Document behavior with a bare `yield` statement (#100416)
ram vikram singh [Sun, 1 Jan 2023 15:36:13 +0000 (21:06 +0530)] 
gh-100201: Document behavior with a bare `yield` statement (#100416)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agogh-96773 Fix documentation of socket backlog (#96778)
Mehrdad Moradizadeh [Sun, 1 Jan 2023 15:06:17 +0000 (10:06 -0500)] 
gh-96773 Fix documentation of socket backlog (#96778)

2 years agogh-100649: Update native_thread_id after fork (gh-100650)
Gabriele N. Tornetta [Sun, 1 Jan 2023 14:20:38 +0000 (14:20 +0000)] 
gh-100649: Update native_thread_id after fork (gh-100650)

Update native_thread_id after fork

2 years agogh-100488: Add is_integer method to fractions.Fraction (#100489)
Shantanu [Sun, 1 Jan 2023 08:44:48 +0000 (02:44 -0600)] 
gh-100488: Add is_integer method to fractions.Fraction (#100489)

2 years agogh-100546: Remove incorrect positional-only marker from eval (#100547)
Shantanu [Sun, 1 Jan 2023 00:59:31 +0000 (18:59 -0600)] 
gh-100546: Remove incorrect positional-only marker from eval (#100547)

All the arguments are positional-only.

The current status after #99476 seems to be to not use positional-only
markers in documentation, hence I've simply removed it.

2 years agoIDLE - fix module browser test (#100647)
Terry Jan Reedy [Sun, 1 Jan 2023 00:01:44 +0000 (19:01 -0500)] 
IDLE - fix module browser test (#100647)

2 years agoFix `pydtrace.d` path comment in `Include/pydtrace.h` (#28539)
Mark Hansen [Sat, 31 Dec 2022 17:10:25 +0000 (04:10 +1100)] 
Fix `pydtrace.d` path comment in `Include/pydtrace.h` (#28539)

2 years agoGH-87002: fix caching documentation in `struct` module (#24164)
Sandeep Subramanian [Sat, 31 Dec 2022 16:57:58 +0000 (22:27 +0530)] 
GH-87002: fix caching documentation in `struct` module (#24164)

2 years agogh-100633 Tutorial: Fix dataclasses import (#100638)
Owain Davies [Sat, 31 Dec 2022 10:23:18 +0000 (17:23 +0700)] 
gh-100633 Tutorial: Fix dataclasses import (#100638)

import dataclass not dataclasses from dataclasses

2 years agogh-94808: Improve coverage of dictresize (GH-100619)
tqxia [Sat, 31 Dec 2022 09:15:30 +0000 (17:15 +0800)] 
gh-94808: Improve coverage of dictresize (GH-100619)

2 years agoGH-85979: Clarify specification of `object.__await__` (#22320)
Paolo Lammens [Sat, 31 Dec 2022 06:24:04 +0000 (07:24 +0100)] 
GH-85979: Clarify specification of `object.__await__` (#22320)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2 years agoImprove comments in itertools uniquification recipes (GH-100631)
Raymond Hettinger [Sat, 31 Dec 2022 02:36:38 +0000 (18:36 -0800)] 
Improve comments in itertools uniquification recipes (GH-100631)

2 years agogh-95778: add doc missing in some places (GH-100627)
Éric [Fri, 30 Dec 2022 21:21:15 +0000 (16:21 -0500)] 
gh-95778: add doc missing in some places (GH-100627)

2 years agogh-100616: Document 'attr' parameter for window.vline() in curses module (#24961)
mathieui [Fri, 30 Dec 2022 16:35:04 +0000 (17:35 +0100)] 
gh-100616: Document 'attr' parameter for window.vline() in curses module (#24961)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2 years agogh-99433: Fix `doctest` failure on `types.MethodWrapperType` (#99434)
Nikita Sobolev [Fri, 30 Dec 2022 11:55:01 +0000 (14:55 +0300)] 
gh-99433: Fix `doctest` failure on `types.MethodWrapperType` (#99434)

2 years agogh-100228: Warn from os.fork() if other threads exist. (#100229)
Gregory P. Smith [Thu, 29 Dec 2022 22:41:39 +0000 (14:41 -0800)] 
gh-100228: Warn from os.fork() if other threads exist. (#100229)

Not comprehensive, best effort warning. There are cases when threads exist on some platforms that this code cannot detect. macOS when API permissions allow and Linux with a readable /proc procfs present are the currently supported cases where a warning should show up reliably.

Starting with a DeprecationWarning for now, it is less disruptive than something like RuntimeWarning and most likely to only be seen in people's CI tests - a good place to start with this messaging.

2 years agogh-100540: Remove obsolete Modules/_ctypes/darwin/ dlfcn shim (GH-100541)
Zachary Ware [Thu, 29 Dec 2022 22:13:28 +0000 (16:13 -0600)] 
gh-100540: Remove obsolete Modules/_ctypes/darwin/ dlfcn shim (GH-100541)

As far as I can tell, this hasn't been actually used since Mac OS X 10.2.

2 years agogh-100583: Improve the `pydoc` documentation (#100590)
ram vikram singh [Thu, 29 Dec 2022 15:17:20 +0000 (20:47 +0530)] 
gh-100583: Improve the `pydoc` documentation  (#100590)

2 years agogh-100600: Fix "coroutine was never awaited" warning in `test_coroutines` (#100601)
Nikita Sobolev [Thu, 29 Dec 2022 15:13:38 +0000 (18:13 +0300)] 
gh-100600: Fix "coroutine was never awaited" warning in `test_coroutines` (#100601)

2 years agogh-100585: Fixed a bug where importlib.resources.as_file was leaving file pointers...
Samet YASLAN [Wed, 28 Dec 2022 21:31:43 +0000 (22:31 +0100)] 
gh-100585: Fixed a bug where importlib.resources.as_file was leaving file pointers open (GH-100586)

* gh-100585: Fixed open fp bug in the imporlib module

* Added news for gh-100585

2 years agoGH-100101: Clarify documentation of zip's strict option (GH-100103)
JustAnotherArchivist [Wed, 28 Dec 2022 21:24:50 +0000 (21:24 +0000)] 
GH-100101: Clarify documentation of zip's strict option (GH-100103)

2 years agoRestore early-out to factor(). Strengthen tests. (GH-100591)
Raymond Hettinger [Wed, 28 Dec 2022 20:29:27 +0000 (12:29 -0800)] 
Restore early-out to factor().  Strengthen tests. (GH-100591)

2 years agogh-94172: Update docs for params removed in 3.12 (#100431)
Hugo van Kemenade [Wed, 28 Dec 2022 19:43:19 +0000 (21:43 +0200)] 
gh-94172: Update docs for params removed in 3.12 (#100431)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2 years agogh-100540: Remove unused Modules/_ctypes/libffi_osx/ (GH-100543)
Zachary Ware [Wed, 28 Dec 2022 19:38:52 +0000 (13:38 -0600)] 
gh-100540: Remove unused Modules/_ctypes/libffi_osx/ (GH-100543)

It was an ancient, modified copy of libffi that has not been in use
since GH-22855.

2 years agogh-100540: Remove obsolete '--with-system-ffi' configure option (GH-100544)
Zachary Ware [Wed, 28 Dec 2022 19:36:03 +0000 (13:36 -0600)] 
gh-100540: Remove obsolete '--with-system-ffi' configure option (GH-100544)

It has had no effect on non-macOS platforms for a long time, and has had
the non-obvious effect of invoking `pkg_config` and not setting
`-DUSING_APPLE_OS_LIBFFI` on macOS since GH-22855.

2 years agogh-100540: Remove unnecessary '-DMACOSX' for ctypes on macOS (GH-100542)
Zachary Ware [Wed, 28 Dec 2022 18:06:58 +0000 (12:06 -0600)] 
gh-100540: Remove unnecessary '-DMACOSX' for ctypes on macOS (GH-100542)

The define was only used to protect a `#pragma clang diagnostic`
setting, which is already better guarded by `__clang__` anwyay.

2 years agogh-100577: Replace `assert(0)` with `Py_UNREACHABLE` in `symtable.c` (#100579)
Nikita Sobolev [Wed, 28 Dec 2022 15:31:53 +0000 (18:31 +0300)] 
gh-100577: Replace `assert(0)` with `Py_UNREACHABLE` in `symtable.c` (#100579)

2 years agoFix mock code coverage. (#100580)
Chris Withers [Wed, 28 Dec 2022 12:36:26 +0000 (12:36 +0000)] 
Fix mock code coverage. (#100580)

2 years agoImprove factor() recipe and fix its tests (GH-100576)
Raymond Hettinger [Wed, 28 Dec 2022 11:13:58 +0000 (03:13 -0800)] 
Improve factor() recipe and fix its tests (GH-100576)

2 years agoRemove skipped test in test for async mocks. (#100559)
Chris Withers [Wed, 28 Dec 2022 10:55:50 +0000 (10:55 +0000)] 
Remove skipped test in test for async mocks. (#100559)

Remove skipped test.

See discussion on https://github.com/python/cpython/pull/25326.
Fix is apparently here, but no-one is confident to review and land: https://github.com/python/cpython/pull/25347.

2 years agoGH-100192: fix `asyncio` subprocess tests to pass env vars to subprocess (#100569)
Kumar Aditya [Wed, 28 Dec 2022 05:46:04 +0000 (11:16 +0530)] 
GH-100192: fix `asyncio` subprocess tests to pass env vars to subprocess (#100569)

2 years agogh-55688: Add note about ending backslashes for raw strings (#94768)
Stanley [Wed, 28 Dec 2022 05:30:42 +0000 (21:30 -0800)] 
gh-55688: Add note about ending backslashes for raw strings (#94768)

Co-authored-by: hauntsaninja <hauntsaninja@gmail.com>
2 years agoadd tests for `asyncio` transport sockets (#100263)
Kumar Aditya [Wed, 28 Dec 2022 04:37:55 +0000 (10:07 +0530)] 
add tests for `asyncio` transport sockets (#100263)

2 years agoFix copy-paste error in `Tools/clinic.py` (#100560)
Nikita Sobolev [Wed, 28 Dec 2022 04:27:57 +0000 (07:27 +0300)] 
Fix copy-paste error in `Tools/clinic.py` (#100560)

2 years agoGH-100342: check for allocation failure in AC `*args` parsing (#100343)
Kumar Aditya [Wed, 28 Dec 2022 04:16:28 +0000 (09:46 +0530)] 
GH-100342: check for allocation failure in AC `*args` parsing (#100343)

2 years agoGH-100192: add more `asyncio` subprocess tests (#100194)
Kumar Aditya [Wed, 28 Dec 2022 04:12:16 +0000 (09:42 +0530)] 
GH-100192: add more `asyncio` subprocess tests (#100194)

2 years agoGH-98831: Modernize a ton of simpler instructions (#100545)
Guido van Rossum [Wed, 28 Dec 2022 01:11:03 +0000 (17:11 -0800)] 
GH-98831: Modernize a ton of simpler instructions (#100545)

* load_const and load_fast aren't families for now
* Don't decref unmoved names
* Modernize GET_ANEXT
* Modernize GET_AWAITABLE
* Modernize ASYNC_GEN_WRAP
* Modernize YIELD_VALUE
* Modernize POP_EXCEPT (in more than one way)
* Modernize PREP_RERAISE_STAR
* Modernize LOAD_ASSERTION_ERROR
* Modernize LOAD_BUILD_CLASS
* Modernize STORE_NAME
* Modernize LOAD_NAME
* Modernize LOAD_CLASSDEREF
* Modernize LOAD_DEREF
* Modernize STORE_DEREF
* Modernize COPY_FREE_VARS (mark it as done)
* Modernize LIST_TO_TUPLE
* Modernize LIST_EXTEND
* Modernize SET_UPDATE
* Modernize SETUP_ANNOTATIONS
* Modernize DICT_UPDATE
* Modernize DICT_MERGE
* Modernize MAP_ADD
* Modernize IS_OP
* Modernize CONTAINS_OP
* Modernize CHECK_EXC_MATCH
* Modernize IMPORT_NAME
* Modernize IMPORT_STAR
* Modernize IMPORT_FROM
* Modernize JUMP_FORWARD (mark it as done)
* Modernize JUMP_BACKWARD (mark it as done)

2 years agogh-100553: Improve accuracy of sqlite3.Row iter test (#100555)
Nikita Sobolev [Wed, 28 Dec 2022 00:58:05 +0000 (03:58 +0300)] 
gh-100553: Improve accuracy of sqlite3.Row iter test (#100555)

2 years agoRemove `NoneType` redefinition from `clinic.py` (#100551)
Nikita Sobolev [Tue, 27 Dec 2022 16:11:39 +0000 (19:11 +0300)] 
Remove `NoneType` redefinition from `clinic.py` (#100551)

2 years agogh-94603: micro optimize list.pop (gh-94604)
Pieter Eendebak [Tue, 27 Dec 2022 10:55:54 +0000 (11:55 +0100)] 
gh-94603: micro optimize list.pop (gh-94604)