Commit Graph

53401 Commits

Author SHA1 Message Date
Tian Gao 5e0abb4788
gh-116750: Add clear_tool_id function to unregister events and callbacks (#124568) 2024-10-01 13:32:55 -04:00
Sam Gross 5aa91c56bf
gh-124296: Remove private dictionary version tag (PEP 699) (#124472) 2024-10-01 12:39:56 -04:00
Serhiy Storchaka 60ff67d010
gh-124842: Fix test.support.import_helper.make_legacy_pyc() (GH-124843)
For source file "path/to/file.py" it created file with incorrect path
"/absolute/path/to/path/to/file.pyc" instead of "path/to/file.pyc".
2024-10-01 16:05:17 +00:00
Bartosz Sławecki 67e01a430f
gh-124594: Create and reuse the same context for the entire asyncio REPL session (#124595)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2024-10-01 14:17:22 +00:00
Victorien 3e3a4d2315
gh-118974: Add `decorator` argument to `make_dataclass` (gh-122723)
This is to allow the `dataclasses.make_dataclass` infrastructure to be used with another decorator that's compliant with `typing.dataclass_transform`. The new `decorator` argument to `dataclasses.make_dataclass` is `dataclasses.dataclass`, which used to be hard coded.
2024-10-01 09:51:51 -04:00
Peter Bierma 133e929a79
gh-124309: Revert eager task factory fix to prevent breaking downstream (#124810)
* Revert "GH-124639: add back loop param to staggered_race (#124700)"

This reverts commit e0a41a5dd1.

* Revert "gh-124309: Modernize the `staggered_race` implementation to support eager task factories (#124390)"

This reverts commit de929f353c.
2024-09-30 18:37:27 -07:00
larryhastings 626d706a66
Minor edit for code clarification in annotationlib. (#124805) 2024-09-30 15:25:56 -07:00
Kirill Podoprigora 1c0bd8bd00
gh-115142: Skip some test cases in ``Lib/test/test_compile`` if ``_testinternalcapi`` is not available (#124474)
* Skip some test cases if "_testinternalcapi" is not available and if the test suite is
   running on another implementation than CPython.
2024-09-30 22:13:23 +03:00
Victor Stinner e44eebfc1e
gh-124613, regrtest: Detect JIT in build info (#124793) 2024-09-30 20:50:41 +02:00
Pablo Galindo Salgado 35541c410d
gh-124613: Don't run perf tests in JIT builds (#124792)
* gh-124613: Don't run perf tests in JIT builds

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>

* Apply suggestions from code review

Co-authored-by: Victor Stinner <vstinner@python.org>

---------

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-09-30 17:57:00 +00:00
sobolevn 6f4d64b048
gh-124722: Fix leak in `test_detach_materialized_dict_no_memory` (GH-124769) 2024-09-29 20:47:45 -05:00
Tian Gao b5774603a0
gh-124400: Use the normal command path for breakpoint commands (#124401)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-09-29 19:46:16 -04:00
Bénédikt Tran 6d0d26eb8c
gh-111495: Add tests for `PyCodec_*` C API (#123343) 2024-09-29 15:22:39 +00:00
Jelle Zijlstra 95581b3551
functools: Give up on lazy-importing types (#124736)
PR #121089 added an eager import for types.MethodType, but
still left the existing hacks for lazily importing from types.

We could also create MethodType internally in functools.py (e.g.,
by using `type(Placeholder.__repr__)`, but it feels not worth it at
this point, so instead I unlazified all the usages of types in the
module.
2024-09-29 06:31:06 -07:00
Serhiy Storchaka 3f27153e07
gh-58573: Fix conflicts between abbreviated long options in the parent parser and subparsers in argparse (GH-124631)
Check for ambiguous options if the option is consumed, not when it is
parsed.
2024-09-29 12:01:03 +03:00
Serhiy Storchaka 95e92ef6c7
gh-116850: Fix argparse for namespaces with not directly writable dict (GH-124667)
It now always uses setattr() instead of setting the dict item to modify
the namespace. This allows to use a class as a namespace.
2024-09-29 11:01:10 +03:00
Serhiy Storchaka f1a2417b9e
gh-61181: Fix support of choices with string value in argparse (GH-124578)
Substrings of the specified string no longer considered valid values.
2024-09-29 10:57:21 +03:00
Serhiy Storchaka dac4ec5286
gh-53834: Fix support of arguments with choices in argparse (GH-124495)
Positional arguments with nargs equal to '?' or '*' no longer check
default against choices.
Optional arguments with nargs equal to '?' no longer check const
against choices.
2024-09-29 10:52:52 +03:00
Serhiy Storchaka 61180446ee
gh-124345: Support abbreviated single-dash long options with = in argparse (GH-124428) 2024-09-29 10:52:07 +03:00
Serhiy Storchaka 9bcadf589a
gh-80259: Fix conflict between type and default=SUPPRESS in argparse (GH-124519)
type() no longer called for SUPPRESS.

This only affects positional arguments with nargs='?'.
2024-09-29 10:47:06 +03:00
Serhiy Storchaka 49e105f948
gh-104860: Fix allow_abbrev=False for single-dash long options (GH-124340) 2024-09-29 10:44:34 +03:00
Kumar Aditya e0a41a5dd1
GH-124639: add back loop param to staggered_race (#124700) 2024-09-29 08:42:46 +05:30
Bénédikt Tran c00964ecd5
gh-124665: Add `_PyCodec_UnregisterError` and `_codecs._unregister_error` (#124677) 2024-09-29 02:25:23 +02:00
Kira 04c837d9d8
gh-124442: make `__static_attributes__` deterministic by sorting (#124492)
Signed-off-by: kp2pml30 <kp2pml30@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-09-28 15:15:43 -07:00
Serhiy Storchaka 69a4063ca5
gh-123339: Fix cases of inconsistency of __module__ and __firstlineno__ in classes (GH-123613)
* Setting the __module__ attribute for a class now removes the
  __firstlineno__ item from the type's dict.
* The _collections_abc and _pydecimal modules now completely replace the
  collections.abc and decimal modules after importing them. This
  allows to get the source of classes and functions defined in these
  modules.
* inspect.findsource() now checks whether the first line number for a
  class is out of bound.
2024-09-28 20:51:49 +03:00
Pablo Galindo Salgado 02b49c5150
gh-107954: Fix configuration type for the perf profiler (#124636) 2024-09-28 01:50:16 +02:00
Mark Shannon 0e21cc6cf8
GH-124547: Clear instance dictionary if memory error occurs during object dealloc (GH-124627) 2024-09-27 14:51:01 -07:00
Emily Morehouse 626668912f
gh-81263: Add assignment expressions to `help` (#124641)
* Add assignment expression (:=) to `help`

* Update index for Assignment Expressions to include pair of `assignment; expression`
2024-09-27 13:59:26 -07:00
Russell Keith-Magee 10d504aecc
gh-124682: Disable test that is prone to intermittent failure on iOS. (#124683)
Disable test that is prone to intermittent failure on iOS.
2024-09-27 10:49:35 -07:00
Raymond Hettinger 4b89c5ebfc
Improve accuracy of kde() invcdf estimates (gh-124637) 2024-09-27 09:56:37 -07:00
sobolevn 9c7657f099
gh-113878: Add `doc` parameter to `dataclasses.field` (gh-114051)
If using `slots=True`, the `doc` parameter ends up in the `__slots__` dict. The `doc` parameter is also in the corresponding `Field` object.
2024-09-27 12:20:49 -04:00
Malcolm Smith 0a3577bdfc
gh-123017: Add Android to the list of platforms where `strftime` doesn't support negative years (#124467)
Add Android to the list of platforms where `strftime` doesn't support negative years
2024-09-27 10:35:18 -04:00
Jelle Zijlstra 365dffbaad
gh-119180: No longer set `__annotations__` in `__main__` (#124634) 2024-09-27 05:49:43 -07:00
sobolevn 3a0e7f5762
gh-124176: Add special support for dataclasses to `create_autospec` (#124429) 2024-09-27 09:48:31 +03:00
Erlend E. Aasland 08e1bbe4a3
gh-86673: Harden `test_ttk.test_element_create_image` (#123335)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-09-27 08:21:15 +02:00
Gregory P. Smith b65f2cdfa7
gh-84559: Change the multiprocessing start method default to `forkserver` (GH-101556)
Change the default multiprocessing start method away from fork to forkserver or spawn on the remaining platforms where it was fork.  See the issue for context.  This makes the default far more thread safe (other than for people spawning threads at import time... - don't do that!).

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-09-26 16:57:19 -07:00
Dino Viehland 83e5dc0f4d
gh-124628: Pyrepl inputs on Windows shouldn't always be blocking reads (#124629) 2024-09-27 00:10:36 +02:00
Bénédikt Tran 5e7eba09bc
gh-89683: add tests for `deepcopy` on frozen dataclasses (gh-123098)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2024-09-26 21:15:28 +00:00
Jelle Zijlstra 2c10832887
gh-119180: Rename SOURCE format to STRING (#124620) 2024-09-26 13:49:48 -07:00
Tian Gao 986a4e1b6f
Cleanup unnecessary curframe_locals usage (#124369) 2024-09-26 09:35:13 -07:00
sobolevn abe5f799e6
gh-124498: Fix `TypeAliasType` not to be generic, when `type_params=()` (#124499) 2024-09-26 17:15:38 +03:00
sobolevn 19fed6cf6e
gh-124234: Improve docs for `Mock.reset_mock` (#124237) 2024-09-26 15:06:52 +03:00
Peter Bierma f923605658
gh-124538: Fix crash when using `gc.get_referents` on an untracked capsule object (#124559) 2024-09-26 12:29:43 +02:00
Victor Stinner 0387c34f7c
gh-124402: Speed up test_free_threading and test_super (#124491)
* Reduce the number of iterations and the number of threads so a
  whole test file takes less than a minute.
* Refactor test_racing_iter_extend() to remove two levels of
  indentation.
* test_monitoring() uses a sleep of 100 ms instead of 1 second.
2024-09-26 10:53:17 +02:00
Ron Frederick 1229cb8c14
gh-120284: Enhance `asyncio.run` to accept awaitable objects (#120566)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-09-26 11:45:08 +05:30
Peter Bierma de929f353c
gh-124309: Modernize the `staggered_race` implementation to support eager task factories (#124390)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-09-26 05:11:17 +00:00
dgpb d9296529eb
gh-119127: functools.partial placeholders (gh-119827) 2024-09-26 01:04:38 +00:00
larryhastings 4defb58d38
Add "annotate" SET_FUNCTION_ATTRIBUTE bit to dis. (#124566) 2024-09-25 17:01:45 -07:00
Jelle Zijlstra 4e829c0e6f
gh-124412: Add helpers for converting annotations to source format (#124551) 2024-09-26 00:01:09 +00:00
Jelle Zijlstra 0268b072d8
gh-119180: Disallow instantiation of ConstEvaluator objects (#124561) 2024-09-25 23:30:17 +00:00