summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* GH-100485: Tweaks to sumprod() (GH-100857)Raymond Hettinger2023-01-083-25/+41
|
* Update copyright years to 2023. (gh-100848)Benjamin Peterson2023-01-089-10/+10
|
* GH-90829: Fix empty iterable error message in min/max (#31181)Nnarol2023-01-082-3/+11
|
* gh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap ↵Nikita Sobolev2023-01-082-40/+28
| | | | | | | memory (GH-24061)" (#100745) * gh-100689: Revert "bpo-41798: pyexpat: Allocate the expat_CAPI on the heap memory (GH-24061)" This reverts commit 7c83eaa536d2f436ae46211ca48692f576c732f0.
* gh-100783: fix os.path.join documentation (#100811)Shantanu2023-01-081-11/+12
| | | | | | - 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
* gh-91851: Micro optimizations for arithmetic between Fractions (#25518)Sergey B Kirpichev2023-01-082-10/+13
| | | | | | | | 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).
* gh-100824: Fix typo in the documentation of ↵busywhitespace2023-01-081-2/+2
| | | | unittest.TestLoader.testNamePatterns (#100825)
* gh-100776: Fix misleading default value in help(input) (#100788)Shantanu2023-01-083-4/+5
|
* GH-100485: Convert from Fast2Sum to 2Sum (GH-100836)Raymond Hettinger2023-01-081-13/+16
|
* gh-100815: Normalize `types` module usage in `copy` module (#100816)Nikita Sobolev2023-01-071-9/+7
|
* gh-100792: Make `email.message.Message.__contains__` twice as fast (#100793)Nikita Sobolev2023-01-072-1/+6
|
* GH-100485: Add math.sumprod() (GH-100677)Raymond Hettinger2023-01-076-10/+548
|
* gh-100673: Removed erroneous note in the get_type_hints docs (#100701)FrozenBob2023-01-071-4/+0
| | | | | Removed erroneous note in the get_type_hints docs typing.get_type_hints still includes base class type hints.
* gh-88696: clean up dead argument to compiler_make_closure (GH-100806)Carl Meyer2023-01-071-23/+7
|
* gh-96127: Fix `inspect.signature` call on mocks (#96335)Nikita Sobolev2023-01-073-1/+30
|
* gh-100690: [mock] hide `ATTRIB_DENY_LIST` and make it immutable (#100819)Nikita Sobolev2023-01-071-2/+6
|
* Add barneygale to CODEOWNERS for pathlib (#100808)Barney Gale2023-01-061-0/+3
|
* gh-100690: Raise an AttributeError when the assert_ prefix is forgotten when ↵Christian Klein2023-01-063-4/+41
| | | | | | | | 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.
* GH-98831: Add some tests for generate_cases.py (#100763)Guido van Rossum2023-01-061-0/+310
| | | | | | - 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>
* gh-91851: Trivial optimizations in Fraction (#100791)Sergey B Kirpichev2023-01-062-5/+9
| | | | | | | 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>
* gh-100758: Refactor initialisation of frame headers into a single function ↵Irit Katriel2023-01-065-53/+21
| | | | (_PyFrame_Initialize) (GH-100759)
* GH-99005: More intrinsics (GH-100774)Mark Shannon2023-01-0616-204/+151
| | | * Remove UNARY_POSITIVE, LIST_TO_TUPLE and ASYNC_GEN_WRAP, replacing them with intrinsics.
* gh-99026 update dataclasses docs for when annotations are inspected (gh-100798)Akshit Tyagi2023-01-061-2/+2
| | | update dataclasses docs for when annotations are inspected
* gh-87691: clarify use of anchor in pathlib docs (#100782)Shantanu2023-01-061-8/+8
| | | | | | | | | | | 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>
* gh-90104: avoid RecursionError on recursive dataclass field repr (gh-100756)Carl Meyer2023-01-063-21/+40
| | | Avoid RecursionError on recursive dataclass field repr
* gh-86082: bpo-41916: allow cross-compiled python to have -pthread set for ↵Dustin Spicuzza2023-01-053-8/+19
| | | | | | | 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.
* gh-87691: add an absolute path pathlib example in / operator docs (GH-100737)Shantanu2023-01-051-1/+8
| | | | | 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
* Add hauntsaninja as tomllib CODEOWNER (#100779)Shantanu2023-01-051-1/+1
|
* gh-100562: improve performance of `pathlib.Path.absolute()` (GH-100563)Barney Gale2023-01-052-5/+10
| | | | | | | | | | | | | | | | 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
* gh-98831: Regenerate Python/opcode_metadata.h (GH-100778)Zachary Ware2023-01-051-4/+1
|
* GH-98831: Update generate_cases.py: register inst, opcode_metadata.h (#100735)Guido van Rossum2023-01-056-37/+456
| | | | | | | | (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>
* GH-99005: Add `CALL_INTRINSIC_1` instruction (GH-100771)Mark Shannon2023-01-0519-361/+336
| | | | | | | | * Remove PRINT_EXPR instruction * Remove STOPITERATION_ERROR instruction * Remove IMPORT_STAR instruction
* GH-100288: Remove LOAD_ATTR_METHOD_WITH_DICT instruction. (GH-100753)Mark Shannon2023-01-058-95/+40
|
* GH-100766: Note that locale.LC_MESSAGES is not universal (GH-100702)Tzu-ping Chung2023-01-051-0/+3
|
* Drop myself from pathlib maintenance (#100757)Brett Cannon2023-01-041-4/+1
|
* gh-100739: Respect mock spec when checking for unsafe prefixes (#100740)Christian Klein2023-01-043-1/+18
| | | Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-100747: some compiler macros use c instead of C to access the compiler ↵Irit Katriel2023-01-041-7/+7
| | | | (#100748)
* GH-100719: Remove the `co_nplaincellvars` field from code objects. (GH-100721)Mark Shannon2023-01-0410-23/+19
|
* gh-100720: refactor calculation of number of frame slots for a code object ↵Irit Katriel2023-01-045-4/+15
| | | | into the new function _PyFrame_NumSlotsForCodeObject (#100722)
* docs: fix `ssizeobjargproc` parameters (#100736)David Lechner2023-01-041-1/+2
|
* GH-86508: skip binding to local addresses of different family in ↵Kumar Aditya2023-01-043-2/+50
| | | | `asyncio.open_connection` (#100615)
* gh-91219: http - use subclassing to override index_pages attribute (GH-100731)Ethan Furman2023-01-033-4/+9
| | | Remove previously added parameter to `__init__`, and recommend subclassing to modify the `index_pages` attribute instead.
* [Enum] docs: replace 'last value' by 'highest value' for Flag auto (GH-100709)Christophe Nanteuil2023-01-031-3/+3
|
* gh-100700: Remove Date and Release fields in past whatsnews (GH-100728)Zachary Ware2023-01-033-6/+1
|
* gh-100146: Steal references from stack when building a list (#100147)L. A. F. Pereira2023-01-035-10/+31
| | | | | | | | | | 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.
* gh-95882: fix regression in the traceback of exceptions propagated from ↵Thomas Grainger2023-01-035-4/+90
| | | | inside a contextlib context manager (#95883)
* gh-89419: gdb: fix bug causing `AttributeError` in py-locals when no frame ↵Eli Schwartz2023-01-032-0/+2
| | | | is available (#100611)
* gh-81611: Improve `range` paragraph in 8.3 of language reference (#98353)4l4k4z4m2023-01-031-3/+2
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* gh-89727: Improve os.walk complexity (#100671)Stanislav Zmiev2023-01-022-6/+7
|
* gh-100637: Fix int and bool __sizeof__ calculation to include the 1 element ↵Ionite2023-01-023-2/+7
| | | | | | | | 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>