summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gh-98831: add variable stack effect support to cases generator (#101309)Irit Katriel2023-01-253-194/+924
|
* gh-101326: Fix regression when passing None to FutureIter.throw (#101327)Shantanu2023-01-253-1/+9
|
* GH-88597: Rename uuid's new CLI args to be in line with uuidgen. (#101248)achhina2023-01-253-27/+32
| | | this way they match an existing uuidgen command line tool.
* Add advice how to freeze fewer modules (#101298)Guido van Rossum2023-01-251-1/+6
| | | (And fix a bug that only occurs when you follow the advice.)
* GH-98831: Elaborate some cases_generator tests (#101299)Guido van Rossum2023-01-251-13/+41
| | | | * Make macro test more elaborate * Add test for 'register inst()'
* Fix some comments in ceval.c and fix lltrace output (#101297)Guido van Rossum2023-01-241-6/+4
| | | | | The comment at the top was rather outdated. :-) Also added a note about the dangers of dump_stack().
* gh-98831: rewrite pattern matching opcodes in the instruction definition DSL ↵Irit Katriel2023-01-245-73/+64
| | | | (#101287)
* GH-100762: Don't call `gen.throw()` in `gen.close()`, unless necessary. ↵Mark Shannon2023-01-249-12/+39
| | | | | | (GH-101013) * Store exception stack depth in YIELD_VALUE's oparg and use it avoid expensive gen.throw() in gen.close() where possible.
* gh-101135: Add backwards compatibility to Windows launcher for older 32-bit ↵Martin Boisvert2023-01-242-34/+124
| | | | | | | versions (GH-101138) Python 2.x and up to 3.4 did not contain the "-32" in their registry name, so the 32 and 64-bit installs were treated equal. Since 3.5/PEP 514 this is no longer true, but we still want to detect the EOL versions correctly in case people are still using them. Additionally, the code to replace a node with one with a lower sort key was buggy (wrong node chosen, replace never happened since parent was always NULL, replaced node never freed, etc)
* gh-92123: Adapt _elementtree to multi-phase init (PEP 489) (#101285)Erlend E. Aasland2023-01-243-130/+280
|
* GH-91375: Purge `asyncio` static variables from globals-to-fix list (#101288)Erlend E. Aasland2023-01-241-23/+0
|
* GH-92123: Pass _elementtree state as parameter (#101189)Erlend E. Aasland2023-01-241-57/+73
|
* no-issue: Add Dong-hee Na as autoconf codeowner (gh-101281)Dong-hee Na2023-01-241-1/+1
|
* gh-101278: Drop -gdwarf-4 flag from the BOLT build (gh-101280)Dong-hee Na2023-01-242-6/+0
|
* gh-98831: rewrite CHECK_EG_MATCH opcode in the instruction definition DSL ↵Irit Katriel2023-01-244-60/+29
| | | | (#101269)
* gh-101060: conditionally add `-fno-reorder-blocks-and-partition` (gh-101061)Gregory Szorc2023-01-243-2/+49
|
* gh-101152: Implement PEP 699 (GH-101193)ram vikram singh2023-01-244-0/+15
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Ken Jin <kenjin@python.org>
* [docs] Mention how to get/set a bigint PyLong via the C API (#101270)Gregory P. Smith2023-01-241-0/+4
| | | | | | We don't need direct C APIs to get at a bigint representation of PyLong but we do want the few people who need to understand how. Additional Author: CAM-Gerlach
* gh-100795: Don't call freeaddrinfo on failure. (#101252)Gregory P. Smith2023-01-232-0/+7
| | | | | | | | | When getaddrinfo returns an error, the output pointer is in an unknown state Don't call freeaddrinfo on it. See the issue for discussion and details with links to reasoning. _Most_ libc getaddrinfo implementations never modify the output pointer unless they are returning success. Co-authored-by: Sergey G. Brester <github@sebres.de> Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
* gh-101261: add test for function with > 255 args (#101262)Irit Katriel2023-01-231-0/+10
|
* gh-59956: Allow the "Trashcan" Mechanism to Work Without a Thread State ↵Eric Snow2023-01-235-24/+92
| | | | | | | | | | | | (gh-101209) We've factored out a struct from the two PyThreadState fields. This accomplishes two things: * make it clear that the trashcan-related code doesn't need any other parts of PyThreadState * allows us to use the trashcan mechanism even when there isn't a "current" thread state We still expect the caller to hold the GIL. https://github.com/python/cpython/issues/59956
* GH-92123: Store _elementtree state in type contexts (#101190)Erlend E. Aasland2023-01-231-17/+21
| | | | - add state pointer to TreeBuilderObject - add state pointer to XMLParserObject
* Added asyncio REPL example to docs. (#101243)Carlton Gibson2023-01-231-0/+12
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-101015: Fix `typing.get_type_hints` with unpacked `*tuple` (PEP 646) ↵Nikita Sobolev2023-01-233-1/+36
| | | | (#101031)
* gh-83122: Deprecate testing element truth values in `ElementTree` (#31149)Jacob Walls2023-01-236-5/+59
| | | | | | | When testing element truth values, emit a DeprecationWarning in all implementations. This had emitted a FutureWarning in the rarely used python-only implementation since ~2.7 and has always been documented as a behavior not to rely on. Matching an element in a tree search but having it test False can be unexpected. Raising the warning enables making the choice to finally raise an exception for this ambiguous behavior in the future.
* Sumprod(): Update citation. Reorder functions. Add final twosum() call. ↵Raymond Hettinger2023-01-221-38/+21
| | | | Improve comments. (#101249)
* gh-101047: Remove vestigial references to macOS libtool options (gh-101048)Gregory Szorc2023-01-223-172/+0
| | | | LIBTOOL_CRUFT and OTHER_LIBTOOL_OPT variables have been unused since commit 19199830f7f880b1e9cff5d92d30706fd8bb4700 in 2011.
* Add Erlend Aasland as autoconf codeowner (#101247)Erlend E. Aasland2023-01-221-0/+3
|
* GH-101097: Switch from standard interval notation to greater or less than ↵Andrew Hong2023-01-222-4/+4
| | | | signs for random.random()'s documentation (#101119)
* gh-67790: Support float-style formatting for Fraction instances (#100161)Mark Dickinson2023-01-225-0/+618
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR adds support for float-style formatting for `Fraction` objects: it supports the `"e"`, `"E"`, `"f"`, `"F"`, `"g"`, `"G"` and `"%"` presentation types, and all the various bells and whistles of the formatting mini-language for those presentation types. The behaviour almost exactly matches that of `float`, but the implementation works with the exact `Fraction` value and does not do an intermediate conversion to `float`, and so avoids loss of precision or issues with numbers that are outside the dynamic range of the `float` type. Note that the `"n"` presentation type is _not_ supported. That support could be added later if people have a need for it. There's one corner-case where the behaviour differs from that of float: for the `float` type, if explicit alignment is specified with a fill character of `'0'` and alignment type `'='`, then thousands separators (if specified) are inserted into the padding string: ```python >>> format(3.14, '0=11,.2f') '0,000,003.14' ``` The exact same effect can be achieved by using the `'0'` flag: ```python >>> format(3.14, '011,.2f') '0,000,003.14' ``` For `Fraction`, only the `'0'` flag has the above behaviour with respect to thousands separators: there's no special-casing of the particular `'0='` fill-character/alignment combination. Instead, we treat the fill character `'0'` just like any other: ```python >>> format(Fraction('3.14'), '0=11,.2f') '00000003.14' >>> format(Fraction('3.14'), '011,.2f') '0,000,003.14' ``` The `Fraction` formatter is also stricter about combining these two things: it's not permitted to use both the `'0'` flag _and_ explicit alignment, on the basis that we should refuse the temptation to guess in the face of ambiguity. `float` is less picky: ```python >>> format(3.14, '0<011,.2f') '3.140000000' >>> format(Fraction('3.14'), '0<011,.2f') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/mdickinson/Repositories/python/cpython/Lib/fractions.py", line 414, in __format__ raise ValueError( ValueError: Invalid format specifier '0<011,.2f' for object of type 'Fraction'; can't use explicit alignment when zero-padding ```
* Revert "gh-100795: avoid unexpected `freeaddrinfo` after failed ↵Kumar Aditya2023-01-222-4/+0
| | | | | | | `getaddrinfo` (#101220)" (#101238) Revert "gh-100795: avoid unexpected `freeaddrinfo` after failed `getaddrinfo` (#101220)" This reverts commit 5f08fe4a2c055880c23c6f9b57ff03005d193bfc.
* gh-100795: avoid unexpected `freeaddrinfo` after failed `getaddrinfo` (#101220)Sergey G. Brester2023-01-222-0/+4
| | | Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
* GH-88597: Added command line interface to UUID module. (#99463)achhina2023-01-226-0/+174
| | | | | | | | | | | | The `uuid` module now supports command line usage. ```python ❯ ./python.exe -m uuid 5f2d57b1-90e8-417c-ba5d-69b9b6f74289 ❯ ./python.exe -m uuid -h usage: uuid.py [-h] [-u {uuid1,uuid3,uuid4,uuid5}] [-ns NAMESPACE] [-n NAME] ... ```
* gh-100518: Add tests for `ast.NodeTransformer` (#100521)Nikita Sobolev2023-01-213-42/+171
|
* gh-100726: Optimize construction of range object for medium sized integers ↵Pieter Eendebak2023-01-213-0/+60
| | | | | | | | (#100810) Use C long arithmetic instead of PyLong arithmetic to compute the range length, where possible. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* gh-99266: ctypes: Preserve more detailed exception in `ArgumentError`Kamil Turek2023-01-215-7/+83
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* GH-92123: Move _elementtree heap types to module state (#101187)Erlend E. Aasland2023-01-213-68/+98
|
* gh-101037: Fix potential memory underallocation for zeros of int subtypes ↵Mark Dickinson2023-01-213-0/+10
| | | | | | | | | (#101038) This PR fixes object allocation in long_subtype_new to ensure that there's at least one digit in all cases, and makes sure that the value of that digit is copied over from the source long. Needs backport to 3.11, but not any further: the change to require at least one digit was only introduced for Python 3.11. Fixes #101037.
* gh-101143: Remove references to `TimerHandle` from ↵J. Nick Koston2023-01-212-6/+5
| | | | | `asyncio.base_events.BaseEventLoop._add_callback` (#101197) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* Bump Azure Pipelines to ubuntu-22.04 (#101089)Hugo van Kemenade2023-01-212-8/+8
|
* Fix rst formatting in 3.12 What's New (#101110)scrazzz2023-01-211-6/+6
|
* gh-91351: Fix some bugs in importlib handling of re-entrant imports (GH-94504)Jean-Paul Calderone2023-01-212-37/+201
| | | Co-authored-by: Brett Cannon <brett@python.org>
* gh-100750: pass encoding kwarg in lib/platform.py (#100751)Thomas Grainger2023-01-202-0/+3
| | | | Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* gh-86610: Use attribute directive in docs for pathlib.PurePath (#101114)Barney Gale2023-01-201-14/+14
|
* GH-101111: Disambigaute origin of const for store_const and append_const ↵Jürgen Gmach2023-01-201-3/+3
| | | | | | | | | (#101121) While the documentation for `optparse` mentioned that both `store_const` and `append_const` store a constant value, it was not clear where this value was coming from. A link to `Option.const` makes this explicit.
* GH-101112: Specify type of pattern for Path.rglob (#101132)Jürgen Gmach2023-01-201-1/+2
| | | | | | | The documentation for `rglob` did not mention what `pattern` actually is. Mentioning and linking to `fnmatch` makes this explicit, as the documentation for `fnmatch` both shows the syntax and some explanation.
* Fix a typo in whatsnew/3.12.rst (#101150)caozhanhao2023-01-201-1/+1
|
* Fix minor typos in SSL documentation (#101158)Simon Robinson2023-01-201-8/+8
|
* gh-91485: Avoid unnecessary use of non-Python syntax in io docs (#101177)Shantanu2023-01-201-2/+2
|
* Fix typo in comment in compile.c (#101194)Ikko Eltociear Ashimine2023-01-201-1/+1
|