summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Docs: for for/else clarify that return or raise also skip the else (#124591)Ned Batchelder2024-09-271-2/+4
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-124176: Add special support for dataclasses to `create_autospec` (#124429)sobolevn2024-09-273-6/+92
|
* gh-86673: Harden `test_ttk.test_element_create_image` (#123335)Erlend E. Aasland2024-09-271-4/+4
| | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* generate_global_objects.py: Fix name of macro in error message (#124464)Jelle Zijlstra2024-09-271-2/+2
| | | _PyID does not exist but _Py_ID does.
* gh-116510: Fix crash during sub-interpreter shutdown (gh-124645)Neil Schemenauer2024-09-272-3/+29
| | | | | 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.
* gh-116510: Fix crash due to shared immortal interned strings. (gh-124646)Neil Schemenauer2024-09-272-6/+47
|
* GH-123516: Improve JIT memory consumption by invalidating cold executors ↵Savannah Ostrowski2024-09-2714-39/+129
| | | | | (GH-124443) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Docs: Update and proofread `library/venv.rst` (#124121)Hugo van Kemenade2024-09-262-132/+131
| | | | | | 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>
* gh-84559: Change the multiprocessing start method default to `forkserver` ↵Gregory P. Smith2024-09-267-33/+75
| | | | | | | | (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>
* gh-124628: Pyrepl inputs on Windows shouldn't always be blocking reads (#124629)Dino Viehland2024-09-261-9/+21
|
* Remove some unused files related to WASM/WASI (GH-124635)Brett Cannon2024-09-263-57/+2
|
* gh-89683: add tests for `deepcopy` on frozen dataclasses (gh-123098)Bénédikt Tran2024-09-261-0/+43
| | | Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
* gh-119180: Rename SOURCE format to STRING (#124620)Jelle Zijlstra2024-09-2611-169/+154
|
* gh-124612: Good bye dockerfile and use GHCR package (gh-124626)Donghee Na2024-09-262-27/+1
|
* gh-115528: Update language reference for PEP 646 (#121181)Matthew Rahtz2024-09-262-17/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Programming FAQ: Mention object.__setattr__ as a technique for delegation ↵Jelle Zijlstra2024-09-261-3/+10
| | | | | | (#124617) This is used for example by threading.local in the stdlib.
* Cleanup unnecessary curframe_locals usage (#124369)Tian Gao2024-09-261-19/+11
|
* gh-124153: Remove `_PyType_GetModuleByDef2` private function (GH-124261)neonene2024-09-264-46/+26
| | | Thank you!
* Doc: Use the short version for daily downloads (#124602)Adam Turner2024-09-261-1/+1
|
* gh-124606: Fix reference leak in error path in `datetime_fromisoformat` in ↵Kirill Podoprigora2024-09-261-0/+2
| | | | | `_datetimemodule.c` (#124607) Previously `tzdata` and `dtstr_clean` were not decrefed in the `invalid_iso_midnight` error path of the `datetime_isoformat` function.
* gh-119127: Fix _functools.Placeholder singleton (#124601)Victor Stinner2024-09-261-13/+35
| | | | | | | * 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.
* gh-124498: Fix `TypeAliasType` not to be generic, when `type_params=()` ↵sobolevn2024-09-263-1/+25
| | | | (#124499)
* gh-119127: functools: Improve docs for partial and Placeholder (#124575)Jelle Zijlstra2024-09-261-15/+17
|
* gh-118181: Fix parameter markup in AST docs (#124473)Tomas R2024-09-261-13/+13
|
* gh-123560: Correct docs for "empty" format type for floats (#123561)Sergey B Kirpichev2024-09-261-3/+5
|
* gh-124234: Improve docs for `Mock.reset_mock` (#124237)sobolevn2024-09-262-12/+37
|
* gh-124538: Fix crash when using `gc.get_referents` on an untracked capsule ↵Peter Bierma2024-09-263-3/+26
| | | | object (#124559)
* gh-124402: Speed up test_free_threading and test_super (#124491)Victor Stinner2024-09-264-53/+41
| | | | | | | * 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.
* gh-101100: Make __subclasses__ doctest stable (#124577)Jelle Zijlstra2024-09-261-2/+4
| | | | | 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.
* gh-120284: Enhance `asyncio.run` to accept awaitable objects (#120566)Ron Frederick2024-09-264-22/+56
| | | | Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-119333: get interp from tstate for PyContext watchers(#124444)Jason Fried2024-09-262-7/+6
| | | Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-124309: Modernize the `staggered_race` implementation to support eager ↵Peter Bierma2024-09-265-66/+100
| | | | | | | | 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>
* gh-119127: functools.partial placeholders (gh-119827)dgpb2024-09-268-129/+681
|
* Add "annotate" SET_FUNCTION_ATTRIBUTE bit to dis. (#124566)larryhastings2024-09-262-1/+19
|
* gh-124412: Add helpers for converting annotations to source format (#124551)Jelle Zijlstra2024-09-265-42/+113
|
* gh-119180: Disallow instantiation of ConstEvaluator objects (#124561)Jelle Zijlstra2024-09-252-2/+14
|
* For-else deserves its own section in the tutorial (#123946)Ned Batchelder2024-09-251-31/+54
| | | | | | | | | | | | | * For-else deserves its own section in the tutorial * remove mention of unrolling the loop * Update Doc/tutorial/controlflow.rst Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> --------- Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Add 3.13 as a version option to the crash issue template (#124560)Zachary Ware2024-09-251-0/+1
|
* gh-123242: Note that type.__annotations__ may not exist (#124557)Jelle Zijlstra2024-09-251-1/+2
| | | | | Closes #123242. The real criterion is that the attribute does not exist on heap types, but I don't think we should discuss heap vs. static types in the language reference.
* gh-119180: Make FORWARDREF format look at __annotations__ first (#124479)Jelle Zijlstra2024-09-252-26/+143
| | | | From discussion with Larry Hastings and Carl Meyer, this is the desired behavior.
* GH-58058: Add quick reference for `ArgumentParser` to argparse docs (gh-124227)Savannah Ostrowski2024-09-251-0/+19
|
* gh-41431: Add `datetime.time.strptime()` and `datetime.date.strptime()` ↵Nice Zombies2024-09-2511-36/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#120752) * Python implementation * C implementation * Test `date.strptime` * Test `time.strptime` * 📜🤖 Added by blurb_it. * Update whatsnew * Update documentation * Add leap year note * Update 2024-06-19-19-53-42.gh-issue-41431.gnkUc5.rst * Apply suggestions from code review Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> * Remove parentheses * Use helper function * Remove bad return * Link to github issue * Fix directive * Apply suggestions from code review Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com> * Fix test cases --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
* gh-102450: Add ISO-8601 alternative for midnight to `fromisoformat()` calls. ↵TizzySaurus2024-09-255-4/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#105856) * Add NEWS.d entry * Allow ISO-8601 24:00 alternative to midnight on datetime.time.fromisoformat() * Allow ISO-8601 24:00 alternative to midnight on datetime.datetime.fromisoformat() * Add NEWS.d entry * Improve error message when hour is 24 and minute/second/microsecond is not 0 * Add tests for 24:00 fromisoformat * Remove duplicate call to days_in_month() by storing in variable * Add Python implementation * Fix Lint * Fix differing error msg in datetime.fromisoformat implementations when 24hrs has non-zero time component(s) * Fix using time components inside tzinfo in Python implementation * Don't parse tzinfo in C implementation when invalid iso midnight * Remove duplicated variable in datetime test assertion line * Add self to acknowledgements * Remove duplicate NEWS entry * Linting * Add missing test case for when wrapping the year makes it invalid (too large)
* gh-124370: Add "howto" for free-threaded Python (#124371)Sam Gross2024-09-253-0/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gh-124370: Add "howto" for free-threaded Python This is a guide aimed at people writing Python code, as oppposed to the existing guide for C API extension authors. * Add missing new line * Update Doc/howto/free-threading-python.rst Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> * interned -> immortalized * Apply suggestions from code review Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> * Update Doc/howto/free-threading-python.rst Co-authored-by: mpage <mpage@cs.stanford.edu> * Update docs * Apply suggestions from code review Co-authored-by: Carol Willing <carolcode@willingconsulting.com> * A few more updates * Additional comment on immortal objects * Mention specializing adaptive interpreter * Remove trailing whitespace * Remove mention of C macro --------- Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: mpage <mpage@cs.stanford.edu> Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* gh-121277: Allow `.. versionadded:: next` in docs (GH-121278)Petr Viktorin2024-09-259-14/+36
| | | | | | | | | | Make `versionchanged:: next`` expand to current (unreleased) version. When a new CPython release is cut, the release manager will replace all such occurences of "next" with the just-released version. (See the issue for release-tools and devguide PRs.) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* gh-119400: make_ssl_certs: update reference test data automatically, pass ↵Alexander Kanavin2024-09-256-72/+72
| | | | | | | | | | | | | | | | | | | in expiration dates as parameters #119400 (GH-119401) * Lib/test/certdata: do not hardcode reference cert data into tests The script was simply printing the reference data and asking users to update it by hand into the test suites. This can be easily improved by writing the data into files and having the test cases load the files. * make_ssl_certs: make it possible to pass in expiration dates from command line Note that in this commit, the defaults are same as they were, so if nothing is specified the script works as before. --------- Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
* gh-119180: Avoid going through AST and eval() when possible in annotationlib ↵Jelle Zijlstra2024-09-252-28/+88
| | | | | | | | | | (#124337) Often, ForwardRefs represent a single simple name. In that case, we can avoid going through the overhead of creating AST nodes and code objects and calling eval(): we can simply look up the name directly in the relevant namespaces. Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-124448: Update Windows builds to use Tcl/Tk 8.6.15 (GH-124449)Zachary Ware2024-09-256-14/+14
|
* gh-123884 Tee of tee was not producing n independent iterators (gh-124490)Raymond Hettinger2024-09-258-89/+91
|
* gh-124378: Update test_ttk for Tcl/Tk 8.6.15 (GH-124542)Zachary Ware2024-09-252-2/+16
| | | Co-authored-by: Marc Culler <culler@users.noreply.github.com>