Commit Graph

123783 Commits

Author SHA1 Message Date
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
Matt Delengowski 2357d5ba48
gh-90190: Add doc for using `singledispatch` with precise collection type hints (#116544) 2024-09-27 21:10:29 +00: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
Mariatta 6cba6e1df2
gh-124457: Remove coverity from CPython repo (GH-124460)
Remove coverity from CPython repo.
2024-09-27 13:42:32 -07:00
Petr Viktorin 3387f76b8f
gh-124520: What's New entry for ctypes metaclass __new__/__init__ change (GH-124546) 2024-09-27 22:13:53 +02:00
Victor Stinner d8cf587dc7
doc: PyUnicode_AsUTF8String() fails if string contains surrogates (#124605) 2024-09-27 20:13:29 +00:00
Raymond Hettinger 34158c2c7a
Drop code ownership for decimal (gh-124695) 2024-09-27 19:33:16 +00:00
Petr Viktorin 81a253b929
Fix typo in InternalDocs/string_interning.md (GH-124699) 2024-09-27 19:31:59 +00:00
Tony Roberts 0881e2d3b1
gh-124609: Fix _Py_ThreadId for Windows builds using MinGW (#124663) 2024-09-27 18:52:23 +00:00
Raymond Hettinger 2e155536ca
Itertool docs: Minor clarifications, wording tweaks, spacing, and active voice. (gh-124690)
Minor clarifications, wording tweaks, spacing, and active voice.
2024-09-27 18:43:46 +00: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
Petr Viktorin e349f73a5a
gh-121277: Raise nice error on `next` as second argument to deprecated-removed (GH-124623) 2024-09-27 19:38:40 +02:00
Alex Waygood 6716dd1c33
Fixup indentation for docs on `ModuleSpec` attributes (#124681)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-09-27 17:35:09 +00:00
Raymond Hettinger 4b89c5ebfc
Improve accuracy of kde() invcdf estimates (gh-124637) 2024-09-27 09:56:37 -07:00
Brandt Bucher 26a74203f0
GH-118093: Fix off-by-one errors in tier-up thresholds (GH-124447) 2024-09-27 09:38:04 -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
Max Bachmann b79a21ea42
GH-95079: document error behaviour for some unicode C APIs (#95080) 2024-09-27 12:35:55 +02:00
Ned Batchelder 5329d1b74a
Docs: for for/else clarify that return or raise also skip the else (#124591)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-09-27 06:17:25 -04: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
Jelle Zijlstra 25189188bf
generate_global_objects.py: Fix name of macro in error message (#124464)
_PyID does not exist but _Py_ID does.
2024-09-26 21:37:21 -07:00
Neil Schemenauer 6f9525dd3f
gh-116510: Fix crash during sub-interpreter shutdown (gh-124645)
Fix a bug that can cause a crash when sub-interpreters use "basic"
single-phase extension modules.  Shared objects could refer to PyGC_Head
nodes that had been freed as part of interpreter shutdown.
2024-09-26 19:33:07 -07:00
Neil Schemenauer 98b2ed7e23
gh-116510: Fix crash due to shared immortal interned strings. (gh-124646) 2024-09-26 19:16:51 -07:00
Savannah Ostrowski 65f1237098
GH-123516: Improve JIT memory consumption by invalidating cold executors (GH-124443)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-09-27 00:35:42 +00:00
Hugo van Kemenade 23e812b84a
Docs: Update and proofread `library/venv.rst` (#124121)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-09-27 02:57:38 +03: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
Brett Cannon 66cc6d4c50
Remove some unused files related to WASM/WASI (GH-124635) 2024-09-26 21:23:41 +00: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
Donghee Na a4d1fdfb15
gh-124612: Good bye dockerfile and use GHCR package (gh-124626) 2024-09-26 12:58:15 -07:00
Matthew Rahtz 7d3497f617
gh-115528: Update language reference for PEP 646 (#121181)
To recap: the objective is to make starred expressions valid in `subscription`,
which is used for generics: `Generic[...]`, `list[...]`, etc.

What _is_ gramatically valid in such contexts? Seemingly any of the following.
(At least, none of the following throw `SyntaxError` in a 3.12.3 REPL.)

    Generic[x]
    Generic[*x]
    Generic[*x, y]
    Generic[y, *x]
    Generic[x := 1]
    Generic[x := 1, y := 2]

So introducting

    flexible_expression: expression | assignment_expression | starred_item

end then switching `subscription` to use `flexible_expression` sorts that.

But then we need to field `yield` - for which any of the following are
apparently valid:

    yield x
    yield x,
    yield x, y
    yield *x,
    yield *x, *y

Introducing a separate `yield_list` is the simplest way I've been figure out to
do this - separating out the special case of `starred_item ,`.



Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-09-26 12:35:17 -07:00
Jelle Zijlstra 43979fad90
Programming FAQ: Mention object.__setattr__ as a technique for delegation (#124617)
This is used for example by threading.local in the stdlib.
2024-09-26 11:50:31 -07:00
Tian Gao 986a4e1b6f
Cleanup unnecessary curframe_locals usage (#124369) 2024-09-26 09:35:13 -07:00
neonene d7248cdbc3
gh-124153: Remove `_PyType_GetModuleByDef2` private function (GH-124261)
Thank you!
2024-09-26 18:21:11 +02:00
Adam Turner 2c472d36b7
Doc: Use the short version for daily downloads (#124602) 2024-09-26 16:44:25 +01:00
Kirill Podoprigora 9c98fdab7d
gh-124606: Fix reference leak in error path in `datetime_fromisoformat` in `_datetimemodule.c` (#124607)
Previously `tzdata` and `dtstr_clean` were not decrefed in the `invalid_iso_midnight` error path of the `datetime_isoformat` function.
2024-09-26 15:30:21 +00:00
Victor Stinner 257a20a817
gh-119127: Fix _functools.Placeholder singleton (#124601)
* The module state now stores a strong reference to the Placeholder
  singleton.
* Use a regular dealloc function.
* Add Py_TPFLAGS_HAVE_GC flag and a traverse function to help the GC
  to collect the type when a _functools extension is unloaded.
2024-09-26 16:50:38 +02:00
sobolevn abe5f799e6
gh-124498: Fix `TypeAliasType` not to be generic, when `type_params=()` (#124499) 2024-09-26 17:15:38 +03:00
Jelle Zijlstra cf2418076d
gh-119127: functools: Improve docs for partial and Placeholder (#124575) 2024-09-26 07:12:56 -07:00
Tomas R 09aebb1fbc
gh-118181: Fix parameter markup in AST docs (#124473) 2024-09-26 06:38:25 -07:00
Sergey B Kirpichev 274d9ab619
gh-123560: Correct docs for "empty" format type for floats (#123561) 2024-09-26 14:40:18 +02: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
Jelle Zijlstra 08a467b537
gh-101100: Make __subclasses__ doctest stable (#124577)
Using a standard library class makes this test difficult to maintain
as other tests and other parts of the stdlib may create subclasses,
which may still be alive when this test runs depending on GC timing.
2024-09-26 06:26:03 +00: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
Jason Fried 46f5cbca4c
gh-119333: get interp from tstate for PyContext watchers(#124444)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-09-26 05:26:23 +00:00