]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-101100: [Enum] Fix sphinx warnings in docs (GH-101122)
Nikita Sobolev [Fri, 20 Jan 2023 02:16:21 +0000 (05:16 +0300)] 
gh-101100: [Enum] Fix sphinx warnings in docs (GH-101122)

* gh-101100: [Enum] Fix sphinx warnings in

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agogh-59956: Fix Function Groupings in pystate.c (gh-101172)
Eric Snow [Fri, 20 Jan 2023 00:23:53 +0000 (17:23 -0700)] 
gh-59956: Fix Function Groupings in pystate.c (gh-101172)

This is a follow-up to gh-101161.  The objective is to make it easier to read Python/pystate.c by grouping the functions there in a consistent way.  This exclusively involves moving code around and adding various kinds of comments.

https://github.com/python/cpython/issues/59956

2 years agogh-101167: fix bug in the new test.support.requires_specialization decorator (GH...
Irit Katriel [Thu, 19 Jan 2023 23:45:53 +0000 (23:45 +0000)] 
gh-101167: fix bug in the new test.support.requires_specialization decorator (GH-101171)

Fixes #101167.

Automerge-Triggered-By: GH:iritkatriel
2 years agogh-101169: reduce the implementation of except* by one bytecode instruction (#101170)
Irit Katriel [Thu, 19 Jan 2023 23:30:49 +0000 (23:30 +0000)] 
gh-101169: reduce the implementation of except* by one bytecode instruction (#101170)

2 years agogh-59956: Clarify GILState-related Code (gh-101161)
Eric Snow [Thu, 19 Jan 2023 23:04:14 +0000 (16:04 -0700)] 
gh-59956: Clarify GILState-related Code (gh-101161)

The objective of this change is to help make the GILState-related code easier to understand.  This mostly involves moving code around and some semantically equivalent refactors.  However, there are a also a small number of slight changes in structure and behavior:

* tstate_current is moved out of _PyRuntimeState.gilstate
* autoTSSkey is moved out of _PyRuntimeState.gilstate
* autoTSSkey is initialized earlier
* autoTSSkey is re-initialized (after fork) earlier

https://github.com/python/cpython/issues/59956

2 years agogh-98831: register instructions have 0 pushes and pops (#101163)
Irit Katriel [Thu, 19 Jan 2023 21:02:56 +0000 (21:02 +0000)] 
gh-98831: register instructions have 0 pushes and pops (#101163)

2 years agogh-100712: make it possible to disable specialization (for debugging) (#100713)
Irit Katriel [Thu, 19 Jan 2023 18:14:55 +0000 (18:14 +0000)] 
gh-100712: make it possible to disable specialization (for debugging) (#100713)

2 years agogh-100940: Change "char *str" to "const char *str" in KeywordToken: It is an immutab...
Stepfen Shawn [Wed, 18 Jan 2023 21:02:48 +0000 (05:02 +0800)] 
gh-100940: Change "char *str" to "const char *str" in KeywordToken:  It is an immutable string. (#100936)

2 years agogh-100340: Allows -Wno-int-conversion for wasm (#100341)
Kushal Das [Wed, 18 Jan 2023 18:43:49 +0000 (19:43 +0100)] 
gh-100340: Allows -Wno-int-conversion for wasm (#100341)

Fixes #100340 allows -Wno-int-conversion for wasm

2 years agoGH-98831: Move assorted macros from ceval.h to a new header (#101116)
Guido van Rossum [Wed, 18 Jan 2023 18:41:07 +0000 (10:41 -0800)] 
GH-98831: Move assorted macros from ceval.h to a new header (#101116)

2 years agofix typo in 3.12 What's New (#101105)
Tushar Sadhwani [Wed, 18 Jan 2023 16:24:56 +0000 (21:54 +0530)] 
fix typo in 3.12 What's New (#101105)

2 years agoDocs: improve sqlite3 placeholders example (#101092)
Erlend E. Aasland [Wed, 18 Jan 2023 09:36:17 +0000 (10:36 +0100)] 
Docs: improve sqlite3 placeholders example (#101092)

2 years agoFix typo and old link in wasm readme (#101096)
Zac Hatfield-Dodds [Wed, 18 Jan 2023 00:06:38 +0000 (11:06 +1100)] 
Fix typo and old link in wasm readme (#101096)

2 years agoGH-98831: Implement array support in cases generator (#100912)
Guido van Rossum [Tue, 17 Jan 2023 23:59:19 +0000 (15:59 -0800)] 
GH-98831: Implement array support in cases generator (#100912)

You can now write things like this:
```
inst(BUILD_STRING, (pieces[oparg] -- str)) { ... }
inst(LIST_APPEND, (list, unused[oparg-1], v -- list, unused[oparg-1])) { ... }
```
Note that array output effects are only partially supported (they must be named `unused` or correspond to an input effect).

2 years agogh-82052: Don't send partial UTF-8 sequences to the Windows API (GH-101103)
Paul Moore [Tue, 17 Jan 2023 19:23:06 +0000 (19:23 +0000)] 
gh-82052: Don't send partial UTF-8 sequences to the Windows API (GH-101103)

Don't send partial UTF-8 sequences to the Windows API

2 years agoFix typo in `ReprEnum` documentation (#101079)
Viicos [Tue, 17 Jan 2023 10:51:56 +0000 (11:51 +0100)] 
Fix typo in `ReprEnum` documentation (#101079)

2 years agogh-101046: Fix a potential memory leak in the parser when raising MemoryError (#101051)
Pablo Galindo Salgado [Mon, 16 Jan 2023 18:45:37 +0000 (18:45 +0000)] 
gh-101046: Fix a potential memory leak in the parser when raising MemoryError (#101051)

2 years agogh-100247: Improve documentation for custom shebang commands in py.exe launcher ...
Steve Dower [Mon, 16 Jan 2023 17:01:04 +0000 (17:01 +0000)] 
gh-100247: Improve documentation for custom shebang commands in py.exe launcher (GH-101083)

2 years agogh-100320: Fix path calculations on Windows when python.exe is moved outside of the...
Steve Dower [Mon, 16 Jan 2023 16:05:39 +0000 (16:05 +0000)] 
gh-100320: Fix path calculations on Windows when python.exe is moved outside of the normal location (GH-100947)

2 years agoGH-100982: Add `COMPARE_AND_BRANCH` instruction (GH-100983)
Mark Shannon [Mon, 16 Jan 2023 12:35:21 +0000 (12:35 +0000)] 
GH-100982: Add `COMPARE_AND_BRANCH` instruction (GH-100983)

2 years agogh-101056: Fix memory leak in `formatfloat()` in `bytesobject.c` (#101057)
Nikita Sobolev [Mon, 16 Jan 2023 10:46:07 +0000 (13:46 +0300)] 
gh-101056: Fix memory leak in `formatfloat()` in `bytesobject.c` (#101057)

2 years agoDocs: Remove duplicate `TraversableResources` reference (#101068)
scrazzz [Mon, 16 Jan 2023 10:44:50 +0000 (13:44 +0300)] 
Docs: Remove duplicate `TraversableResources` reference (#101068)

2 years agoGH-100997: fix refleak in `_testinternalcapi.c` (#101058)
Kumar Aditya [Mon, 16 Jan 2023 10:41:57 +0000 (16:11 +0530)] 
GH-100997: fix refleak in `_testinternalcapi.c` (#101058)

2 years agogh-101041: Fix a misspelled name of `utctimetuple` in a doc warning (GH-101042)
Oleg Iarygin [Sun, 15 Jan 2023 20:36:31 +0000 (00:36 +0400)] 
gh-101041: Fix a misspelled name of `utctimetuple` in a doc warning (GH-101042)

2 years agoFix `ctypes` typo in `set_exception` (#101040)
Cristián Maureira-Fredes [Sun, 15 Jan 2023 15:12:37 +0000 (16:12 +0100)] 
Fix `ctypes` typo in `set_exception` (#101040)

2 years agoGH-100892: consolidate `HEAD_LOCK/HEAD_UNLOCK` macros (#100953)
Kumar Aditya [Sun, 15 Jan 2023 15:09:26 +0000 (20:39 +0530)] 
GH-100892: consolidate `HEAD_LOCK/HEAD_UNLOCK` macros (#100953)

2 years agogh-100668: Clarify how sqlite3 maps parameters onto placeholders (#100960)
Erlend E. Aasland [Sat, 14 Jan 2023 22:58:06 +0000 (23:58 +0100)] 
gh-100668: Clarify how sqlite3 maps parameters onto placeholders (#100960)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2 years agogh-94518: [_posixsubprocess] Replace variable validity flags with reserved values...
Oleg Iarygin [Sat, 14 Jan 2023 20:11:04 +0000 (00:11 +0400)] 
gh-94518: [_posixsubprocess] Replace variable validity flags with reserved values (#94687)

Have _posixsubprocess.c stop using boolean flags to say if gid and uid values were supplied and action is required.  Such an implicit "either initialized or look somewhere else" confused both the reader (another mental connection to constantly track between functions) and a compiler (warnings on potentially uninitialized variables being passed). Instead, we can utilize a special group/user id as a flag value -1 defined by POSIX but used nowhere else. Namely:

gid: call_setgid = False → gid = -1

uid: call_setuid = False → uid = -1

groups: call_setgroups = False → groups = NULL (obtained with (groups_list != Py_None) ? groups : NULL)

This PR is required for #94519.

2 years agogh-101021: Document binary parameters as bytes (#101024)
Bob Kline [Sat, 14 Jan 2023 19:01:27 +0000 (14:01 -0500)] 
gh-101021: Document binary parameters as bytes (#101024)

2 years agoSync-up parameter name in equivalent code snippet of `enumerate` (GH-101029)
JustAnotherArchivist [Sat, 14 Jan 2023 05:55:35 +0000 (05:55 +0000)] 
Sync-up parameter name in equivalent code snippet of `enumerate` (GH-101029)

2 years agoGH-98831: Identify instructions that don't use oparg (#100957)
Guido van Rossum [Sat, 14 Jan 2023 01:06:45 +0000 (17:06 -0800)] 
GH-98831: Identify instructions that don't use oparg (#100957)

For these the instr_format field uses IX instead of IB.
Register instructions use IX, IB, IBBX, IBBB, etc.

Also: Include the closing '}' in Block.tokens, for completeness

2 years agoAdd recipes to showcase tee(), zip*, batched, starmap, and product. (GH-101023)
Raymond Hettinger [Sat, 14 Jan 2023 01:01:22 +0000 (19:01 -0600)] 
Add recipes to showcase tee(), zip*, batched, starmap, and product. (GH-101023)

2 years agoFix typo in docs (GH-101025)
Raymond Hettinger [Sat, 14 Jan 2023 00:53:06 +0000 (18:53 -0600)] 
Fix typo in docs (GH-101025)

2 years agogh-74033: Fix bug when Path takes and ignores **kwargs (GH-19632)
Yurii Karabas [Sat, 14 Jan 2023 00:05:43 +0000 (02:05 +0200)] 
gh-74033: Fix bug when Path takes and ignores **kwargs (GH-19632)

Fix a bug where `Path` takes and ignores `**kwargs` by adding to `PurePath`  class `__init__` method which can take only positional arguments.

Automerge-Triggered-By: GH:brettcannon
2 years agoGH-100573: Fix server hang caused by os.stat() on named pipe (Windows) (#100959)
Guido van Rossum [Fri, 13 Jan 2023 21:24:57 +0000 (13:24 -0800)] 
GH-100573: Fix server hang caused by os.stat() on named pipe (Windows) (#100959)

2 years agoDon't double count misses. (GH-100984)
Mark Shannon [Fri, 13 Jan 2023 15:57:39 +0000 (15:57 +0000)] 
Don't double count misses. (GH-100984)

2 years agogh-100160: Restore and deprecate implicit creation of an event loop (GH-100410)
Serhiy Storchaka [Fri, 13 Jan 2023 12:40:29 +0000 (14:40 +0200)] 
gh-100160: Restore and deprecate implicit creation of an event loop (GH-100410)

Partially revert changes made in GH-93453.

asyncio.DefaultEventLoopPolicy.get_event_loop() now emits a
DeprecationWarning and creates and sets a new event loop instead of
raising a RuntimeError if there is no current event loop set.

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
2 years agogh-100247: Fix py.exe launcher not using entire shebang command for finding custom...
Steve Dower [Fri, 13 Jan 2023 11:49:01 +0000 (11:49 +0000)] 
gh-100247: Fix py.exe launcher not using entire shebang command for finding custom commands (GH-100944)

2 years agogh-86682: Adds sys._getframemodulename as an alternative to using _getframe (GH-99520)
Steve Dower [Fri, 13 Jan 2023 11:31:06 +0000 (11:31 +0000)] 
gh-86682: Adds sys._getframemodulename as an alternative to using _getframe (GH-99520)

Also updates calls in collections, doctest, enum, and typing modules to use _getframemodulename first when available.

2 years agoGH-100942: Fix incorrect cast in property_copy(). (#100965)
Raymond Hettinger [Thu, 12 Jan 2023 22:13:56 +0000 (16:13 -0600)] 
GH-100942: Fix incorrect cast in property_copy(). (#100965)

2 years agoGH-100997: Implement Multi-Phase Init for the _testinternalcapi Module (gh-100998)
Eric Snow [Thu, 12 Jan 2023 20:42:03 +0000 (13:42 -0700)] 
GH-100997: Implement Multi-Phase Init for the _testinternalcapi Module (gh-100998)

_testinternalcapi is an internal module used for testing.

https://github.com/python/cpython/issues/100997

2 years agogh-96290: Support partial/invalid UNC drives in ntpath.normpath() and splitdrive...
Barney Gale [Thu, 12 Jan 2023 19:24:57 +0000 (19:24 +0000)] 
gh-96290: Support partial/invalid UNC drives in ntpath.normpath() and splitdrive() (GH-100351)

This brings the Python implementation of `ntpath.normpath()` in line with the C implementation added in 99fcf15

Co-authored-by: Eryk Sun <eryksun@gmail.com>
2 years agogh-96461: Improve docs for bytecode instructions (GH-96462)
Matthieu Dartiailh [Thu, 12 Jan 2023 18:23:50 +0000 (19:23 +0100)] 
gh-96461: Improve docs for bytecode instructions  (GH-96462)

* Clarify the meaning of the oparg for CACHE and COPY opcode in dis doc

* Use STACK to describe stack operation in analogy with a Python list

* Remove (delta) from BEFORE_WITH since BEFORE_WITH does not take an argument

* Fix the description of the stack impact of multiple opcodes

2 years agoGH-81381: Add longer comment _PyType_AllocNoTrack() (GH-100954)
Neil Schemenauer [Thu, 12 Jan 2023 18:03:50 +0000 (10:03 -0800)] 
GH-81381: Add longer comment _PyType_AllocNoTrack() (GH-100954)

The details on the "nitems+1" expression is a bit subtle so add a longer
comment about it.

2 years agoFix typo in `enum` module documentation (#100992)
Noam Cohen [Thu, 12 Jan 2023 15:40:29 +0000 (17:40 +0200)] 
Fix typo in `enum` module documentation (#100992)

2 years agoGH-100894: Updated the doc for `sys.winver` to clarify its usual contents (GH-100913)
ram vikram singh [Thu, 12 Jan 2023 00:11:12 +0000 (05:41 +0530)] 
GH-100894: Updated the doc for `sys.winver` to clarify its usual contents (GH-100913)

2 years agogh-98636: Fix detecting gdbm_compat for _dbm module (#98643)
Michał Górny [Wed, 11 Jan 2023 21:46:28 +0000 (22:46 +0100)] 
gh-98636: Fix detecting gdbm_compat for _dbm module (#98643)

Fix the gdbm_compat library detection logic to actually check for
-lgdbm_compat independently of the ndbm detection.
This fixes the build failure with `--with-dbmliborder=gdbm`,
and implicit fallback to ndbm with the default value.

2 years agogh-94912: Adjusted check for non-standard coroutine function marker. (#100935)
Carlton Gibson [Wed, 11 Jan 2023 21:17:26 +0000 (22:17 +0100)] 
gh-94912: Adjusted check for non-standard coroutine function marker. (#100935)

The initial implementation did not correctly identify explicitly
marked class instances.

Follow up to 532aa4e4e019812d0388920768ede7c04232ebe1

2 years agoGH-100923: Embed jump mask in `COMPARE_OP` oparg (GH-100924)
Mark Shannon [Wed, 11 Jan 2023 20:40:43 +0000 (20:40 +0000)] 
GH-100923: Embed jump mask in `COMPARE_OP` oparg (GH-100924)

2 years agoEnsure some build files include a newline at to avoid warnings (GH-100946)
th1722 [Wed, 11 Jan 2023 17:28:57 +0000 (02:28 +0900)] 
Ensure some build files include a newline at to avoid warnings (GH-100946)

2 years agoSkip py.exe launcher tests in full layout CI test (GH-100948)
Steve Dower [Wed, 11 Jan 2023 17:25:46 +0000 (17:25 +0000)] 
Skip py.exe launcher tests in full layout CI test (GH-100948)

These tests become flaky when py.exe exists on the test machine but isn't the one that was just built. They also don't provide any useful information for this scenario, so easiest to just skip them.

2 years agogh-100871: Improve `copy` module tests (GH-100872)
Nikita Sobolev [Wed, 11 Jan 2023 17:14:41 +0000 (20:14 +0300)] 
gh-100871: Improve `copy` module tests (GH-100872)

CC @AlexWaygood as the reviewer of https://github.com/python/cpython/pull/100818

Automerge-Triggered-By: GH:AlexWaygood
2 years agoGH-100892: Fix race in clearing `threading.local` (#100922)
Kumar Aditya [Wed, 11 Jan 2023 10:33:31 +0000 (16:03 +0530)] 
GH-100892: Fix race in clearing `threading.local` (#100922)

2 years agogh-98763: Prefer "python" over "python3" for command line examples in docs. (#98761)
Mariusz Felisiak [Wed, 11 Jan 2023 10:05:41 +0000 (11:05 +0100)] 
gh-98763: Prefer "python" over "python3" for command line examples in docs. (#98761)

2 years agogh-100931: Test all `pickle` protocols in `test_slice` (#100932)
Nikita Sobolev [Wed, 11 Jan 2023 09:43:45 +0000 (12:43 +0300)] 
gh-100931: Test all `pickle` protocols in `test_slice` (#100932)

2 years agoPost 3.12.0a4
Thomas Wouters [Tue, 10 Jan 2023 16:40:11 +0000 (17:40 +0100)] 
Post 3.12.0a4

2 years agoPython 3.12.0a4 v3.12.0a4
Thomas Wouters [Tue, 10 Jan 2023 12:07:54 +0000 (13:07 +0100)] 
Python 3.12.0a4

2 years agoGH-100117: Make `co_lines` more efficient (GH-100447)
Brandt Bucher [Tue, 10 Jan 2023 10:56:53 +0000 (02:56 -0800)] 
GH-100117: Make `co_lines` more efficient (GH-100447)

2 years agogh-100916: Convert argument to appropriate type (GH-100917)
Yao-Ching Huang [Tue, 10 Jan 2023 10:17:57 +0000 (18:17 +0800)] 
gh-100916: Convert argument to appropriate type (GH-100917)

2 years agoFix typos in Doc folder (#100880)
Semen Zhydenko [Tue, 10 Jan 2023 09:04:06 +0000 (10:04 +0100)] 
Fix typos in Doc folder (#100880)

2 years agogh-100180: Update macOS installer to OpenSSL 1.1.1s (GH-100908)
Ned Deily [Tue, 10 Jan 2023 05:10:31 +0000 (00:10 -0500)] 
gh-100180: Update macOS installer to OpenSSL 1.1.1s (GH-100908)

2 years agogh-100893: update bpo reference in Mac README (GH-100905)
Ned Deily [Tue, 10 Jan 2023 03:37:10 +0000 (22:37 -0500)] 
gh-100893: update bpo reference in Mac README (GH-100905)

2 years agoGH-98831: Refactor instr format code and change to enum (#100895)
Guido van Rossum [Mon, 9 Jan 2023 23:53:01 +0000 (15:53 -0800)] 
GH-98831: Refactor instr format code and change to enum (#100895)

2 years agogh-100180: Update Windows installer to OpenSSL 1.1.1s (GH-100901)
Steve Dower [Mon, 9 Jan 2023 23:50:59 +0000 (23:50 +0000)] 
gh-100180: Update Windows installer to OpenSSL 1.1.1s (GH-100901)

2 years agobpo-28356: Document os.rename() behavior on Windows for differing volumes (GH-27376)
Ryan Ozawa [Mon, 9 Jan 2023 21:43:09 +0000 (13:43 -0800)] 
bpo-28356: Document os.rename() behavior on Windows for differing volumes (GH-27376)

2 years agoGH-100126: Skip incomplete frames in more places (GH-100613)
Brandt Bucher [Mon, 9 Jan 2023 20:20:04 +0000 (12:20 -0800)] 
GH-100126: Skip incomplete frames in more places (GH-100613)

2 years agogh-100882: Improve `test_pickling` case in `test_ast.py` (#100883)
Nikita Sobolev [Mon, 9 Jan 2023 19:20:25 +0000 (22:20 +0300)] 
gh-100882: Improve `test_pickling` case in `test_ast.py` (#100883)

2 years agogh-99191: Use correct check for MSVC C++ version support in _wmimodule.cpp (GH-100381)
C.A.M. Gerlach [Mon, 9 Jan 2023 17:48:24 +0000 (11:48 -0600)] 
gh-99191: Use correct check for MSVC C++ version support in _wmimodule.cpp (GH-100381)

2 years agogh-100873: Fix "‘lo’ may be used uninitialized in this function" warning in `mathmodu...
Nikita Sobolev [Mon, 9 Jan 2023 15:51:24 +0000 (18:51 +0300)] 
gh-100873: Fix "‘lo’ may be used uninitialized in this function" warning in `mathmodule.c` (#100881)

2 years agoGH-81061: Fix refcount issue when returning `None` from a `ctypes.py_object` callback...
dgelessus [Mon, 9 Jan 2023 10:13:04 +0000 (11:13 +0100)] 
GH-81061: Fix refcount issue when returning `None` from a `ctypes.py_object` callback (#13364)

2 years agofix up mock tests coverage (#100874)
Chris Withers [Mon, 9 Jan 2023 10:08:56 +0000 (10:08 +0000)] 
fix up mock tests coverage (#100874)

2 years agogh-100764: add `pycore_frame.h` to PYTHON_HEADERS and Windows build files(#100765)
Carl Meyer [Mon, 9 Jan 2023 09:05:56 +0000 (02:05 -0700)] 
gh-100764: add `pycore_frame.h` to PYTHON_HEADERS and Windows build files(#100765)

2 years agoGH-100813: Add `socket.IP_PKTINFO` constant (#10294)
dsentinel [Mon, 9 Jan 2023 09:00:40 +0000 (01:00 -0800)] 
GH-100813: Add `socket.IP_PKTINFO` constant (#10294)

2 years agoUpdate copyright year in README (GH-100863)
Ned Deily [Mon, 9 Jan 2023 02:53:56 +0000 (21:53 -0500)] 
Update copyright year in README (GH-100863)

Co-authored-by: HARSHA VARDHAN <75431678+Thunder-007@users.noreply.github.com>
2 years agogh-87447: Fix walrus comprehension rebind checking (#100581)
Nikita Sobolev [Sun, 8 Jan 2023 22:51:29 +0000 (01:51 +0300)] 
gh-87447: Fix walrus comprehension rebind checking (#100581)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2 years agoUpdate additional copyright years to 2023. (GH-100859)
Ned Deily [Sun, 8 Jan 2023 22:05:28 +0000 (17:05 -0500)] 
Update additional copyright years to 2023. (GH-100859)

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.