summaryrefslogtreecommitdiffstats
path: root/Misc
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] gh-118772: Allow TypeVars without a default to follow those with a ↵Miss Islington (bot)2024-05-081-0/+2
| | | | | | | default when constructing aliases (GH-118774) (#118776) (cherry picked from commit aac6b019fe91e2f9f7a955d4fc4db5d5efd968c9) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Python 3.13.0b1v3.13.0b1Thomas Wouters2024-05-08158-381/+1670
|
* gh-118734: Fixes Windows build when Use_TIER2 is unspecified (#118735)Steve Dower2024-05-071-0/+2
|
* gh-118660: Add second type parameter to (Async)ContextManager (#118681)Jelle Zijlstra2024-05-071-0/+4
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-66410: Do not stringify arguments of Tkinter callback (GH-98592)Serhiy Storchaka2024-05-071-0/+7
| | | | | | | | | Callbacks registered in the tkinter module now take arguments as various Python objects (int, float, bytes, tuple), not just str. To restore the previous behavior set tkinter module global wantobject to 1 before creating the Tk object or call the wantobject() method of the Tk object with argument 1. Calling it with argument 2 restores the current default behavior.
* gh-118090: Improve error message for empty type param brackets (GH-118091)Nikita Sobolev2024-05-071-0/+1
|
* gh-118518: Rename `PYTHONPERFJITSUPPORT` and `-X perfjit` with underscores ↵Hugo van Kemenade2024-05-071-2/+2
| | | | (#118693)
* gh-118418: Deprecate failing to pass a value to the *type_params* parameter ↵Alex Waygood2024-05-071-0/+6
| | | | of some private `typing` APIs (#118695)
* gh-118650: Exclude `_repr_*` methods from Enum's _sunder_ reservation ↵chrysn2024-05-071-0/+2
| | | | (GH-118651)
* gh-109975: Update 'What's New in Python 3.13' for beta (#118694)Hugo van Kemenade2024-05-075-7/+9
|
* gh-118314: Fix padding edge case in binascii.a2b_base64 strict mode (GH-118320)Youfu Zhang2024-05-071-0/+1
| | | | | | | Fix an edge case in `binascii.a2b_base64` strict mode, where excessive padding was not detected when no padding is necessary. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
* gh-62090: Simplify argparse usage formatting (GH-105039)Ali Hamdan2024-05-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rationale ========= argparse performs a complex formatting of the usage for argument grouping and for line wrapping to fit the terminal width. This formatting has been a constant source of bugs for at least 10 years (see linked issues below) where defensive assertion errors are triggered or brackets and paranthesis are not properly handeled. Problem ======= The current implementation of argparse usage formatting relies on regular expressions to group arguments usage only to separate them again later with another set of regular expressions. This is a complex and error prone approach that caused all the issues linked below. Special casing certain argument formats has not solved the problem. The following are some of the most common issues: - empty `metavar` - mutually exclusive groups with `SUPPRESS`ed arguments - metavars with whitespace - metavars with brackets or paranthesis Solution ======== The following two comments summarize the solution: - https://github.com/python/cpython/issues/82091#issuecomment-1093832187 - https://github.com/python/cpython/issues/77048#issuecomment-1093776995 Mainly, the solution is to rewrite the usage formatting to avoid the group-then-separate approach. Instead, the usage parts are kept separate and only joined together at the end. This allows for a much simpler implementation that is easier to understand and maintain. It avoids the regular expressions approach and fixes the corresponding issues. This closes the following GitHub issues: - #62090 - #62549 - #77048 - #82091 - #89743 - #96310 - #98666 These PRs become obsolete: - #15372 - #96311
* gh-118107: Fix zipimporter ZIP64 handling. (GH-118108)John Sirois2024-05-071-0/+2
| | | | | | | | | | | | Add missing import to code that handles too large files and offsets. Use list, not tuple, for a mutable sequence. Add tests to prevent similar mistakes. --------- Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* gh-118414: Fix assertion in YIELD_VALUE when tracing lines or instrs (#118683)Tian Gao2024-05-071-0/+1
|
* gh-117953: Always Run Extension Init Func in Main Interpreter First (gh-118157)Eric Snow2024-05-071-0/+8
| | | This change makes sure all extension/builtin modules have their init function run first by the main interpreter before proceeding with import in the original interpreter (main or otherwise). This means when the import of a single-phase init module fails in an isolated subinterpreter, it won't tie any global state/callbacks to the subinterpreter.
* gh-116322: Enable the GIL while loading C extension modules (#118560)Brett Simmers2024-05-071-0/+1
| | | | | | | | | | Add the ability to enable/disable the GIL at runtime, and use that in the C module loading code. We can't know before running a module init function if it supports free-threading, so the GIL is temporarily enabled before doing so. If the module declares support for running without the GIL, the GIL is later disabled. Otherwise, the GIL is permanently enabled, and will never be disabled again for the life of the current interpreter.
* gh-110209: Add __class_getitem__ for generator and coroutine (#110212)James Hilton-Balfe2024-05-071-0/+1
|
* gh-118473: Fix set_asyncgen_hooks not to be partially set when arguments are ↵Jeong, YunWon2024-05-071-0/+1
| | | | invalid (#118474)
* gh-117486: Improve behavior for user-defined AST subclasses (#118212)Jelle Zijlstra2024-05-061-0/+4
| | | | | | | | Now, such classes will no longer require changes in Python 3.13 in the normal case. The test suite for robotframework passes with no DeprecationWarnings under this PR. I also added a new DeprecationWarning for the case where `_field_types` exists but is incomplete, since that seems likely to indicate a user mistake.
* gh-118647: Add defaults to typing.Generator and typing.AsyncGenerator (#118648)Jelle Zijlstra2024-05-061-0/+2
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-115119: Default to --with-system-libmpdec=yes (#118539)Erlend E. Aasland2024-05-061-0/+2
| | | Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
* GH-83151: Add closure support to pdb (GH-111094)Tian Gao2024-05-061-0/+3
|
* gh-118362: Fix thread safety around lookups from the type cache in the face ↵Dino Viehland2024-05-061-0/+2
| | | | | | | of concurrent mutators (#118454) Add _PyType_LookupRef and use incref before setting attribute on type Makes setting an attribute on a class and signaling type modified atomic Avoid adding re-entrancy exposing the type cache in an inconsistent state by decrefing after type is updated
* GH-117714: implement athrow().close() and asend().close() using throw ↵Thomas Grainger2024-05-061-0/+1
| | | | | | | | | | | | | | | | | | (GH-117906) * GH-117714: replace athrow().close() and asend().close() stubs with implimentations * test athrow().close() and asend().close() raises RuntimeError * 📜🤖 Added by blurb_it. * Update Objects/genobject.c Co-authored-by: Petr Viktorin <encukou@gmail.com> --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL ↵Petr Viktorin2024-05-061-1/+1
| | | | (GH-118645)
* gh-118271: Support more options for reading/writing images in Tkinter ↵Serhiy Storchaka2024-05-061-0/+4
| | | | | | | | (GH-118273) * Add PhotoImage.read() to read an image from a file. * Add PhotoImage.data() to get the image data. * Add background and grayscale parameters to PhotoImage.write().
* gh-118225: Support more options for copying images in Tkinter (GH-118228)Serhiy Storchaka2024-05-061-0/+5
| | | | | | | | * Add the PhotoImage method copy_replace() to copy a region from one image to other image, possibly with pixel zooming and/or subsampling. * Add from_coords parameter to PhotoImage methods copy(), zoom() and subsample(). * Add zoom and subsample parameters to PhotoImage method copy().
* gh-116871: Improve name suggestions in tracebacks (GH-116930)Serhiy Storchaka2024-05-061-0/+2
| | | | | Only include underscored names in name suggestions for AttributeError and ImportError if the original name was underscored.
* gh-66543: Add mimetypes.guess_file_type() (GH-117258)Serhiy Storchaka2024-05-061-0/+3
|
* gh-118465: Add __firstlineno__ attribute to class (GH-118475)Serhiy Storchaka2024-05-061-0/+2
| | | | It is set by compiler with the line number of the first line of the class definition.
* gh-95382: Improve performance of json encoder with indent (GH-118105)Pieter Eendebak2024-05-061-0/+2
|
* gh-78955: Use user-selected color theme for Help => IDLE Doc (#9502)Terry Jan Reedy2024-05-061-0/+1
|
* Add Lysandros Nikolaou to the News entry of gh-111201 (#118616)Pablo Galindo Salgado2024-05-051-2/+2
|
* gh-111201: A new Python REPL (GH-111567)Pablo Galindo Salgado2024-05-051-0/+4
| | | | | | | Co-authored-by: Łukasz Langa <lukasz@langa.pl> Co-authored-by: Marta Gómez Macías <mgmacias@google.com> Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-117549: Don't use designated initializers in headers (#118580)Guido van Rossum2024-05-051-0/+5
| | | | | | | The designated initializer syntax in static inline functions in pycore_backoff.h causes problems for C++ or MSVC users who aren't yet using C++20. While internal, pycore_backoff.h is included (indirectly, via pycore_code.h) by some key 3rd party software that does so for speed.
* gh-74929: Rudimentary docs for PEP 667 (#118581)Guido van Rossum2024-05-051-1/+3
| | | | | | | | | This is *not* sufficient for the final 3.13 release, but it will do for beta 1: - What's new entry - Updated changelog entry (news blurb) - Mention the proxy for f_globals in the datamodel and Python frame object docs This doesn't have any C API details (what's new refers to the PEP).
* GH-111744: Make breakpoint() enter the debugger immediately (GH-118579)Tian Gao2024-05-051-0/+1
|
* gh-101137: Add `text/x-rst` to `mimetypes` (#118593)Nikita Sobolev2024-05-051-0/+1
|
* gh-83505: Add markdown mimetype mapping (#17995)Ryan Batchelder2024-05-051-0/+1
|
* gh-118131: Command-line interface for the `random` module (#118132)Hugo van Kemenade2024-05-051-0/+2
|
* gh-118164: Break a loop between _pydecimal and _pylong and optimize int to ↵Serhiy Storchaka2024-05-051-0/+4
| | | | | | | | | | | | | | | | | | | | str conversion (GH-118483) For converting large ints to strings, CPython invokes a function in _pylong.py, which uses the decimal module to implement an asymptotically waaaaay sub-quadratic algorithm. But if the C decimal module isn't available, CPython uses _pydecimal.py instead. Which in turn frequently does str(int). If the int is very large, _pylong ends up doing the work, which in turn asks decimal to do "big" arithmetic, which in turn calls str(big_int), which in turn ... it can become infinite mutual recursion. This change introduces a different int->str function that doesn't use decimal. It's asymptotically worse, "Karatsuba time" instead of quadratic time, so still a huge improvement. _pylong switches to that when the C decimal isn't available. It is also used for not too large integers (less than 450_000 bits), where it is faster (up to 2 times for 30_000 bits) than the asymptotically better implementation that uses the C decimal. Co-authored-by: Tim Peters <tim.peters@gmail.com>
* gh-118518: Allow perf to work without frame pointers (#112254)Pablo Galindo Salgado2024-05-051-0/+4
|
* gh-118164: str(10**10000) hangs if the C _decimal module is missing (#118503)Tim Peters2024-05-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial stab. * Test the tentative fix. Hangs "forever" without this change. * Move the new test to a better spot. * New comment to explain why _convert_to_str allows any poewr of 10. * Fixed a comment, and fleshed out an existing test that appeared unfinished. * Added temporary asserts. Or maybe permanent ;-) * Update Lib/_pydecimal.py Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * Remove the new _convert_to_str(). Serhiy and I independently concluded that exact powers of 10 aren't possible in these contexts, so just checking the string length is sufficient. * At least for now, add the asserts to the other block too. * 📜🤖 Added by blurb_it. --------- Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-109617: fix ncurses incompatibility on macOS with Xcode 15 (#111258)Davide Rizzo2024-05-041-0/+2
| | | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* GH-111744: Support opcode events in bdb (GH-111834)Tian Gao2024-05-041-0/+1
|
* gh-74929: Implement PEP 667 (GH-115153)Tian Gao2024-05-042-0/+7
|
* gh-113081: Print colorized exception just like built-in traceback in pdb ↵Tian Gao2024-05-041-0/+1
| | | | (#113082)
* gh-111997: C-API for signalling monitoring events (#116413)Irit Katriel2024-05-041-0/+1
|
* gh-107674: Improve performance of `sys.settrace` (GH-117133)Tian Gao2024-05-031-0/+1
| | | | | | * Check tracing in RESUME_CHECK * Only change to RESUME_CHECK if not tracing
* gh-83856: Honor atexit for all multiprocessing start methods (GH-114279)Tian Gao2024-05-031-0/+1
| | | | | Use atexit for all multiprocessing start methods to cleanup. See the GH-114279 PR discussion and related issue for details as to why.