Commit graph

121246 commits

Author SHA1 Message Date
Victor Stinner
b1236a4410
gh-113317, AC: Add libclinic.function (#116807)
Move Module, Class, Function and Parameter classes to a new
libclinic.function module.

Move VersionTuple and Sentinels to libclinic.utils.
2024-03-14 14:37:22 +00:00
Victor Stinner
a76288ad9b
gh-116646, AC: Always use PyObject_AsFileDescriptor() in fildes (#116806)
The fildes converter of Argument Clinic now always call
PyObject_AsFileDescriptor(), not only for the limited C API.

The _PyLong_FileDescriptor_Converter() converter stays as a fallback
when PyObject_AsFileDescriptor() cannot be used.
2024-03-14 14:58:07 +01:00
Victor Stinner
2a54c4b25e
gh-116646, AC: Add CConverter.use_converter() method (#116793)
Only add includes when the converter is effectively used.
2024-03-14 13:57:02 +01:00
Victor Stinner
97b80af897
gh-85283: Build fcntl extension with the limited C API (#116791) 2024-03-14 12:01:13 +00:00
Nikita Sobolev
f20dfb7569
gh-116780: Fix test_inspect in -OO mode (#116788) 2024-03-14 13:16:18 +03:00
Serhiy Storchaka
19ac28bd08
gh-90300: Fix undocumented envvars in the Python CLI help (GH-116765) 2024-03-14 12:09:19 +02:00
Nikita Sobolev
61f576a5ef
gh-113308: Remove some internal parts of uuid module (#115934)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-03-14 13:01:41 +03:00
Nikita Sobolev
66fb613d90
gh-116785: Fix direct invocation of test_inspect (#116787) 2024-03-14 12:55:54 +03:00
Victor Stinner
d4028724f2
gh-116646: Add limited C API support to AC fildes converter (#116769)
Add tests on the "fildes" converter to _testclinic_limited.
2024-03-14 10:28:58 +01:00
Victor Stinner
a18c9854e8
gh-113317, AC: Move warn() and fail() to libclinic.errors (#116770) 2024-03-14 08:07:01 +00:00
Brett Cannon
3a25d9c5a9
GH-114736: Use WASI SDK 21 (GH-116771) 2024-03-14 01:45:33 +00:00
Brett Cannon
8c094c3095
GH-115983: skip building shared modules for testing under WASI (GH-116528) 2024-03-13 23:25:50 +00:00
Sergey B Kirpichev
e39795f2cb
Docs: PyUnstable_Long_IsCompact() docs now mention PyLong_AsNativeBytes() (#116634) 2024-03-14 00:01:13 +01:00
guangwu
7af4b9f253
Docs: fix spelling of the word 'transferring' (#116641) 2024-03-13 23:53:32 +01:00
Michael Droettboom
cef0ec1a3c
gh-116760: Fix pystats for trace attempts (GH-116761)
There are now at least two bytecodes that may attempt to optimize,
JUMP_BACK, and more recently, COLD_EXIT.

Only the JUMP_BACK was counting the attempt in the stats.
This moves that counter to uop_optimize itself so it should
always happen no matter where it is called from.
2024-03-13 22:13:33 +00:00
Serhiy Storchaka
8c6db45ce3
gh-90300: Document equivalent -X options for envvars in the Python CLI help (GH-116756) 2024-03-13 22:59:16 +02:00
Brett Cannon
61733a2fb9
GH-115979: update test_importlib to work under WASI SDK 21 (GH-116754) 2024-03-13 13:24:28 -07:00
Raymond Hettinger
5ff012a449
Better presentation order for recipes. (gh-116755) 2024-03-13 15:02:56 -05:00
Serhiy Storchaka
e54bdeab9c
gh-90300: Sort the -X options and some envvars in the Python CLI help (GH-116739) 2024-03-13 21:15:44 +02:00
Sam Gross
98ab21cce6
gh-116631: Fix race condition in test_shutdown_immediate_put_join (#116670)
The test case had a race condition: if `q.task_done()` was executed
after `shutdown(immediate=True)`, then it would raise an exception
because the immediate shutdown already emptied the queue. This happened
rarely with the GIL (due to the switching interval), but frequently in
the free-threaded build.
2024-03-13 14:56:28 -04:00
Nikita Sobolev
25684e7131
gh-100746: Improve test_named_expressions.py (#116713) 2024-03-13 21:12:40 +03:00
Nir Friedman
7f418fb111
gh-98731: Improvements to the logging documentation (GH-101618)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2024-03-13 15:58:30 +00:00
Sam Gross
8e2aab7ad5
gh-116604: Fix test_gc on free-threaded build (#116662)
The free-threaded GC only does full collections, so it uses a threshold that
is a maximum of a fixed value (default 2000) and proportional to the number of
live objects. If there were many live objects after the previous collection,
then the threshold may be larger than 10,000 causing
`test_indirect_calls_with_gc_disabled` to fail.

This manually sets the threshold to `(1000, 0, 0)` for the test. The `0`
disables the proportional scaling.
2024-03-13 13:27:36 +00:00
Vinay Sajip
186af3cf21
[doc]: Update cookbook recipe for Qt6. (GH-116719) 2024-03-13 13:22:47 +00:00
Victor Stinner
612f1ec988
gh-110918: Fix side effects of regrtest test_match_tests() (#116718)
test_match_tests now saves and restores patterns.

Add get_match_tests() function to libregrtest.filter.

Previously, running test_regrtest multiple times in a row only ran
tests once: "./python -m test test_regrtest -R 3:3.
2024-03-13 14:20:33 +01:00
Serhiy Storchaka
33662d4e01
gh-90300: Fix cmdline.rst (GH-116721)
* Fix the description of the "-b" option.
* Add references to environment variables for "-s" and "-X dev" options.
2024-03-13 15:03:13 +02:00
Ken Jin
617aca9e74
gh-115419: Change default sym to not_null (GH-116562) 2024-03-13 20:57:48 +08:00
Nikita Sobolev
fcd49b4f47
gh-116714: Handle errors correctly in PyFloat_GetInfo (#116715)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-03-13 12:38:03 +00:00
Serhiy Storchaka
aa7bcf284f
gh-116401: Fix blocking os.fwalk() and shutil.rmtree() on opening a named pipe (GH-116421) 2024-03-13 11:40:28 +02:00
Tian Gao
8332e85b2f
gh-116626: Emit CALL events for all INSTRUMENTED_CALL_FUNCTION_EX (GH-116627) 2024-03-13 08:28:01 +00:00
Laurie O
ba82a241ac
gh-96471: Add ShutDown to queue.py '__all__' (#116699) 2024-03-13 07:21:30 +00:00
Raymond Hettinger
e82f6dfae5
Modernize roundrobin() recipe and improve variable names (gh-116710) 2024-03-13 02:12:30 -05:00
Nikita Sobolev
ee0dbbc045
gh-116491: Improve test_win32_ver (#116506) 2024-03-13 09:46:48 +03:00
Nikita Sobolev
27df81d564
gh-115264: Fix test_functools with -00 mode (#115276) 2024-03-13 09:41:37 +03:00
Terry Jan Reedy
43986f5567
gh-111307: Update design FAQ 'switch' entry (#115899) 2024-03-13 01:30:39 -04:00
Mariusz Felisiak
3f1b6efee9
Docs: fix broken links (#116651) 2024-03-12 21:19:33 -07:00
Raymond Hettinger
93a687a373
Minor clarity improvement for the iter_index() recipe. Also add value subsequence tests. (gh-116696) 2024-03-12 21:33:42 -05:00
Tim Peters
bf121d6a69
GH-116554: Relax list.sort()'s notion of "descending" runs (#116578)
* GH-116554: Relax list.sort()'s notion of "descending" run

Rewrote `count_run()` so that sub-runs of equal elements no longer end a descending run. Both ascending and descending runs can have arbitrarily many sub-runs of arbitrarily many equal elements now. This is tricky, because we only use ``<`` comparisons, so checking for equality doesn't come "for free". Surprisingly, it turned out there's a very cheap (one comparison) way to determine whether an ascending run consisted of all-equal elements. That sealed the deal.

In addition, after a descending run is reversed in-place, we now go on to see whether it can be extended by an ascending run that just happens to be adjacent. This succeeds in finding at least one additional element to append about half the time, and so appears to more than repay its cost (the savings come from getting to skip a binary search, when a short run is artificially forced to length MIINRUN later, for each new element `count_run()` can add to the initial run).

While these have been in the back of my mind for years, a question on StackOverflow pushed it to action:

https://stackoverflow.com/questions/78108792/

They were wondering why it took about 4x longer to sort a list like:

[999_999, 999_999, ..., 2, 2, 1, 1, 0, 0]

than "similar" lists. Of course that runs very much faster after this patch.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
2024-03-12 19:59:42 -05:00
Sam Gross
7d1abe9502
gh-116682: stdout may be empty in test_cancel_futures_wait_false (#116683)
If the `shutdown()` call happens before the worker thread starts executing
the task, then nothing will be printed to stdout.
2024-03-12 20:11:58 -04:00
Thomas Wouters
3f54d1cfe7 Merge branch 'main' of https://github.com/python/cpython 2024-03-13 00:46:31 +01:00
Thomas Wouters
128fbdf97b Post 3.13.0a5 2024-03-13 00:46:17 +01:00
Tian Gao
a53cc3f494
GH-116098: Remove dead frame object creation code (GH-116687) 2024-03-12 23:35:28 +00:00
Tushar Sadhwani
149f7f7ae2
Add typing.NamedTuple in glossary section for named tuples (#108327) 2024-03-12 15:46:42 -07:00
Donghee Na
3325699ffa
gh-116621: Set manual critical section for list.extend (gh-116657) 2024-03-13 07:28:23 +09:00
Raymond Hettinger
126186674e
Beef-up tests for the itertool docs. (gh-116679) 2024-03-12 17:19:58 -05:00
Jelle Zijlstra
290330714b
gh-89547: typing.rst: Add note about change in behavior with ClassVar/Final (#116686) 2024-03-12 15:17:53 -07:00
Jason R. Coombs
a254807761
gh-116307: Proper fix for 'mod' leaking across importlib tests (#116680)
gh-116307: Create a new import helper 'isolated modules' and use that instead of 'Clean Import' to ensure that tests from importlib_resources don't leave modules in sys.modules.
2024-03-12 21:36:21 +00:00
Thomas Wouters
076d169ebb Python 3.13.0a5 2024-03-12 21:11:08 +01:00
Hugo van Kemenade
bb66600558
CI: Process stale issues twice per day (#116636) 2024-03-12 19:49:26 +02:00
Victor Stinner
f6e7a6ce65
gh-116656: Fix test_capi test_py_config_isoloated_per_interpreter() (#116658)
Don't parse argv when setting the configuration, to avoid SystemExit if parsing argv fails.
2024-03-12 18:31:35 +01:00