]>
git.ipfire.org Git - thirdparty/Python/cpython.git/log
Eric Snow [Wed, 12 Jan 2022 23:28:46 +0000 (16:28 -0700)]
bpo-45953: Statically allocate the main interpreter (and initial thread state). (gh-29883)
Previously, the main interpreter was allocated on the heap during runtime initialization. Here we instead embed it into _PyRuntimeState, which means it is statically allocated as part of the _PyRuntime global. The same goes for the initial thread state (of each interpreter, including the main one). Consequently there are fewer allocations during runtime/interpreter init, fewer possible failures, and better memory locality.
FYI, this also helps efforts to consolidate globals, which in turns helps work on subinterpreter isolation.
https://bugs.python.org/issue45953
Jelle Zijlstra [Wed, 12 Jan 2022 19:38:25 +0000 (11:38 -0800)]
bpo-46342: make @typing.final introspectable (GH-30530)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Christian Heimes [Wed, 12 Jan 2022 19:27:37 +0000 (21:27 +0200)]
bpo-40280: Allow to compile _testcapi as builtin module (GH-30559)
Tim Peters [Wed, 12 Jan 2022 18:55:02 +0000 (12:55 -0600)]
bpo-46020: Optimize long_pow for the common case (GH-30555)
This cuts a bit of overhead by not initializing the table of small
odd powers unless it's needed for a large exponent.
Nikita Sobolev [Wed, 12 Jan 2022 16:48:10 +0000 (19:48 +0300)]
bpo-46348: modernize `test_typing` (GH-30547)
Christian Heimes [Wed, 12 Jan 2022 15:08:19 +0000 (17:08 +0200)]
bpo-40280: Add --with-emscripten-target to build for browser or node (GH-30552)
Co-authored-by: Ethan Smith <ethan@ethanhs.me>
Yury Selivanov [Wed, 12 Jan 2022 00:35:19 +0000 (16:35 -0800)]
bpo-46347: Yet another fix in the erorr path of PyEval_EvalCodeEx (#30554)
Yury Selivanov [Tue, 11 Jan 2022 23:37:09 +0000 (15:37 -0800)]
bpo-46347: Fix PyEval_EvalCodeEx to correctly cleanup in error paths (#30551)
Victor Stinner [Tue, 11 Jan 2022 23:35:26 +0000 (00:35 +0100)]
bpo-46303: Fix fileutils.h compiler warnings (GH-30550)
Add missing pycore_fileutils.h include in _tkinter.c and
_testconsole.c.
Yury Selivanov [Tue, 11 Jan 2022 22:25:28 +0000 (14:25 -0800)]
bpo-46347: Fix memory leak in PyEval_EvalCodeEx. (#30546)
First introduced in
0332e569c12d3dc97171546c6dc10e42c27de34b
Ben Kehoe [Tue, 11 Jan 2022 19:15:42 +0000 (12:15 -0700)]
bpo-46307: Add string.Template.get_identifiers() method (GH-30493)
Add `string.Template.get_identifiers()` method that returns the identifiers within the template. By default, raises an error if it encounters an invalid identifier (like `substitute()`). The keyword-only argument `raise_on_invalid` can be set to `False` to ignore invalid identifiers (like `safe_substitute()`).
Automerge-Triggered-By: GH:warsaw
Eric Snow [Tue, 11 Jan 2022 16:37:24 +0000 (09:37 -0700)]
bpo-45953: Statically allocate and initialize global bytes objects. (gh-30096)
The empty bytes object (b'') and the 256 one-character bytes objects were allocated at runtime init. Now we statically allocate and initialize them.
https://bugs.python.org/issue45953
Julien Palard [Tue, 11 Jan 2022 16:32:42 +0000 (17:32 +0100)]
[doc] Add license_url for python-docs-theme 2022.1. (GH-30527)
Pablo Galindo Salgado [Tue, 11 Jan 2022 16:30:39 +0000 (16:30 +0000)]
bpo-46339: Fix crash in the parser when computing error text for multi-line f-strings (GH-30529)
Automerge-Triggered-By: GH:pablogsal
Julian Gilbey [Tue, 11 Jan 2022 14:33:06 +0000 (14:33 +0000)]
closes bpo-46253: Change Py_UNICODE to Py_UCS4 in the C API docs to match the current source code (GH-30387)
Michael Oliver [Tue, 11 Jan 2022 13:59:26 +0000 (13:59 +0000)]
Remove unused `Any` from `Concatenate` example in typing docs (GH-30516)
Mark Shannon [Tue, 11 Jan 2022 11:29:48 +0000 (11:29 +0000)]
News item for issue 46314. (GH-30515)
Mark Shannon [Tue, 11 Jan 2022 11:28:30 +0000 (11:28 +0000)]
bpo-46331: Do not set line number of instruction storing doc-string. (GH-30518)
Victor Stinner [Tue, 11 Jan 2022 10:56:16 +0000 (11:56 +0100)]
bpo-46303: Move fileutils.h private functions to internal C API (GH-30484)
Move almost all private functions of Include/cpython/fileutils.h to
the internal C API Include/internal/pycore_fileutils.h.
Only keep _Py_fopen_obj() in Include/cpython/fileutils.h, since it's
used by _testcapi which must not use the internal C API.
Move EncodeLocaleEx() and DecodeLocaleEx() functions from _testcapi
to _testinternalcapi, since the C API moved to the internal C API.
Nikita Sobolev [Tue, 11 Jan 2022 10:51:34 +0000 (13:51 +0300)]
bpo-46310: simplify `for` loop in `asyncio/windows_events` (GH-30334)
Sam Gross [Tue, 11 Jan 2022 03:03:09 +0000 (22:03 -0500)]
bpo-46205: exit if no workers are alive in runtest_mp (GH-30470)
Arie Bovenberg [Mon, 10 Jan 2022 23:43:39 +0000 (00:43 +0100)]
bpo-46244: Remove __slots__ from typing.TypeVar, .ParamSpec (#30444)
* add missing __slots__ to typing._TypeVarLike
* add news entry
* remove slots from _TypeVarLike base classes
* cleanup diff
* fix broken link in blurb
Nikita Sobolev [Mon, 10 Jan 2022 23:42:45 +0000 (02:42 +0300)]
bpo-45331: [Enum] add rule to docs that mixin type must be subclassable (GH-30521)
Nikita Sobolev [Mon, 10 Jan 2022 19:12:34 +0000 (22:12 +0300)]
bpo-46327: [Enum] remove skipped tests (GH-30512)
Nikita Sobolev [Mon, 10 Jan 2022 19:09:00 +0000 (22:09 +0300)]
bpo-46301: [Enum] fix refleak tests (GH30510)
Irit Katriel [Mon, 10 Jan 2022 18:59:21 +0000 (18:59 +0000)]
bpo-46332: use raise..from instead of assigning __cause__ and raising (GH-30517)
Mark Shannon [Mon, 10 Jan 2022 12:29:02 +0000 (12:29 +0000)]
bpo-46314: Remove extra RESUME when compiling a lamdba. (GH-30513)
Raymond Hettinger [Mon, 10 Jan 2022 02:02:06 +0000 (20:02 -0600)]
bpo-46270: Describe the `in` and `not in` operators as membership tests. (GH-30504)
Inada Naoki [Mon, 10 Jan 2022 01:38:33 +0000 (10:38 +0900)]
bpo-23882: unittest: Drop PEP 420 support from discovery. (GH-29745)
Mark Dickinson [Sun, 9 Jan 2022 16:22:54 +0000 (16:22 +0000)]
bpo-46272: Fix two heading comments in python.gram (GH-30499)
One typo fix and one heading change, both in comments. No functional changes.
Serhiy Storchaka [Sun, 9 Jan 2022 13:32:25 +0000 (15:32 +0200)]
bpo-37295: Use constant-time comb() and perm() for larger n depending on k (GH-30305)
Ethan Smith [Sun, 9 Jan 2022 10:58:59 +0000 (02:58 -0800)]
bpo-40280: Disable epoll_create in Emscripten config.site (GH-30494)
Co-authored-by: nick.pope@infogrid.io
Mark Dickinson [Sun, 9 Jan 2022 10:28:34 +0000 (10:28 +0000)]
Add a (conservative) timeout for Windows builds on GitHub Actions (GH-30301)
Thomas Klausner [Sun, 9 Jan 2022 00:54:13 +0000 (01:54 +0100)]
bpo-46308: Fix unportable test(1) operator in configure script (GH-30490)
Nikita Sobolev [Sat, 8 Jan 2022 20:13:42 +0000 (23:13 +0300)]
bpo-46306: simplify `CodeType` attribute access in `doctest.py` (GH-30481)
Assume co_firstlineno always exists on types.CodeType objects.
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Nikita Sobolev [Sat, 8 Jan 2022 19:43:42 +0000 (22:43 +0300)]
bpo-46301: [Enum] test uncomparable values in `_convert_` (GH-30472)
add tests that cover different types, and same non-comparable types
Erlend Egeberg Aasland [Sat, 8 Jan 2022 19:17:09 +0000 (20:17 +0100)]
bpo-46261: Update `sqlite3.Cursor.lastrowid` docs (GH-30407)
Zsolt Dollenstein [Sat, 8 Jan 2022 10:56:35 +0000 (10:56 +0000)]
bpo-46290: Fix parameter names in dataclasses docs (GH-30450)
Dong-hee Na [Sat, 8 Jan 2022 08:14:40 +0000 (17:14 +0900)]
bpo-46299: Improve test_descr (GH-30475)
Nikita Sobolev [Sat, 8 Jan 2022 03:51:51 +0000 (06:51 +0300)]
bpo-46299: improve `test_descr.py` with stricter error handling (GH-30471)
Dennis Sweeney [Sat, 8 Jan 2022 03:47:58 +0000 (22:47 -0500)]
bpo-46235: Do all ref-counting at once during list/tuple multiplication (GH-30346)
When multiplying lists and tuples by `n`, increment each element's refcount, by `n`, just once.
Saves `n-1` increments per element, and allows for a leaner & faster copying loop.
Code by sweeneyde (Dennis Sweeney).
Pablo Galindo Salgado [Sat, 8 Jan 2022 00:23:40 +0000 (00:23 +0000)]
bpo-46237: Fix the line number of tokenizer errors inside f-strings (GH-30463)
Steve Dower [Sat, 8 Jan 2022 00:06:53 +0000 (00:06 +0000)]
bpo-46217: Revert use of Windows constant that is newer than what we support (GH-30473)
Daniel [Fri, 7 Jan 2022 22:26:00 +0000 (00:26 +0200)]
bpo-46297: Fix interpreter crash on startup with multiple PythonPaths set in registry (GH-30466)
Nikita Sobolev [Fri, 7 Jan 2022 21:44:21 +0000 (00:44 +0300)]
bpo-46296: [Enum] add a test for missing `value` recovery (GH-30458)
In `__set_name__` there is a check for the `_value_` attribute and an attempt to add it if missing; this adds a test to cover the case for simple enums with a custom `__new__` method.
Batuhan Taskaya [Fri, 7 Jan 2022 21:05:28 +0000 (00:05 +0300)]
bpo-46289: Make conversion of FormattedValue not optional on ASDL (GH-30467)
Automerge-Triggered-By: GH:isidentical
Hugo van Kemenade [Fri, 7 Jan 2022 19:41:23 +0000 (21:41 +0200)]
bpo-28546: [doc] Clarify setting pdb breakpoints (GH-30360)
Co-authored-by: Ian Kelling <ian@iankelling.org>
Jacob Walls [Fri, 7 Jan 2022 18:39:40 +0000 (13:39 -0500)]
bpo-24650: Use full term "generator function" in yield expressions docs (GH-24663)
Irit Katriel [Fri, 7 Jan 2022 18:28:08 +0000 (18:28 +0000)]
bpo-46216: remove spurious link to os.system() from os.time() documentation (GH-30326)
Automerge-Triggered-By: GH:iritkatriel
Erlend Egeberg Aasland [Fri, 7 Jan 2022 14:08:19 +0000 (15:08 +0100)]
bpo-46070: Fix asyncio initialisation guard (GH-30423)
If init flag is set, exit successfully immediately.
If not, only set the flag after successful initialization.
Christian Heimes [Fri, 7 Jan 2022 08:15:20 +0000 (10:15 +0200)]
bpo-45723: Fix detection of epoll (#30449)
andrei kulakov [Fri, 7 Jan 2022 06:50:30 +0000 (01:50 -0500)]
bpo-41011: venv -- add more variables to pyvenv.cfg (GH-30382)
Vinay Sajip [Thu, 6 Jan 2022 22:35:08 +0000 (22:35 +0000)]
bpo-46251: Add 'Security Considerations' section to logging configura… (GH-30411)
Christian Heimes [Thu, 6 Jan 2022 19:49:03 +0000 (21:49 +0200)]
bpo-46263: Fix second location that needs MALLOC_CONF on FreeBSD (GH-30440)
Automerge-Triggered-By: GH:tiran
Irit Katriel [Thu, 6 Jan 2022 19:43:16 +0000 (19:43 +0000)]
bpo-46286: use the new POP_JUMP_IF_NOT_NONE opcode to simplify except* (GH-30439)
Automerge-Triggered-By: GH:iritkatriel
neonene [Thu, 6 Jan 2022 19:13:10 +0000 (04:13 +0900)]
bpo-46208: Fix normalization of relative paths in _Py_normpath()/os.path.normpath (GH-30362)
Irit Katriel [Thu, 6 Jan 2022 19:05:34 +0000 (19:05 +0000)]
bpo-45292: [PEP-654] exception groups and except* documentation (GH-30158)
Eric Snow [Thu, 6 Jan 2022 18:56:13 +0000 (11:56 -0700)]
bpo-46263: Do not ever expect "use_frozen_modules" to be -1. (gh-30438)
The condition is no longer valid. This should resolve the buildbot failure on FreeBSD.
https://bugs.python.org/issue46263
Christian Heimes [Thu, 6 Jan 2022 15:14:49 +0000 (17:14 +0200)]
bpo-46263: FreeBSD 14.0 jemalloc workaround for junk bytes of freed memory (GH-30434)
Automerge-Triggered-By: GH:tiran
Kumar Aditya [Thu, 6 Jan 2022 13:21:24 +0000 (18:51 +0530)]
bpo-46278: fix typo introduced in GH-30427 (GH-30430)
Automerge-Triggered-By: GH:asvetlov
Mark Shannon [Thu, 6 Jan 2022 13:09:25 +0000 (13:09 +0000)]
bpo-45923: Handle call events in bytecode (GH-30364)
* Add a RESUME instruction to handle "call" events.
Andrew Svetlov [Thu, 6 Jan 2022 12:31:32 +0000 (14:31 +0200)]
Reflect 'context' arg in 'AbstractEventLoop.call_*()' methods (GH-30427)
penguin_wwy [Thu, 6 Jan 2022 11:38:35 +0000 (19:38 +0800)]
bpo-46031: add POP_JUMP_IF_NOT_NONE and POP_JUMP_IF_NONE (GH-30019)
Victor Stinner [Thu, 6 Jan 2022 07:53:44 +0000 (08:53 +0100)]
bpo-46006: Revert "bpo-40521: Per-interpreter interned strings (GH-20085)" (GH-30422)
This reverts commit
ea251806b8dffff11b30d2182af1e589caf88acf .
Keep "assert(interned == NULL);" in _PyUnicode_Fini(), but only for
the main interpreter.
Keep _PyUnicode_ClearInterned() changes avoiding the creation of a
temporary Python list object.
Nikita Sobolev [Wed, 5 Jan 2022 20:21:04 +0000 (23:21 +0300)]
bpo-46266: Add calendar day of week constants to __all__ (GH-30412)
Nikita Sobolev [Wed, 5 Jan 2022 17:06:02 +0000 (20:06 +0300)]
bpo-46269: [Enum] remove special-casing of `__new__` in `EnumType.__dir__` (GH-30421)
Raymond Hettinger [Wed, 5 Jan 2022 15:39:10 +0000 (07:39 -0800)]
bpo-46257: Convert statistics._ss() to a single pass algorithm (GH-30403)
Inada Naoki [Wed, 5 Jan 2022 12:25:54 +0000 (21:25 +0900)]
bpo-46236: Fix PyFunction_GetAnnotations() returned tuple. (GH-30409)
Automerge-Triggered-By: GH:pablogsal
Simon McVittie [Wed, 5 Jan 2022 11:53:23 +0000 (11:53 +0000)]
bpo-43137: Revert "webbrowser: Don't run gvfs-open on GNOME" (GH-30417)
gvfs-open was deprecated in 2015 and removed in 2018, but its replacement,
gio(1), is not available in Ubuntu 16.04, which is apparently still
supported by CPython upstream even though it is considered to be EOL by
Ubuntu developers.
Signed-off-by: Simon McVittie <smcv@debian.org>
Brandt Bucher [Wed, 5 Jan 2022 11:30:26 +0000 (03:30 -0800)]
bpo-45256: Don't track the exact depth of each `InterpreterFrame` (GH-30372)
Christian Heimes [Wed, 5 Jan 2022 09:54:17 +0000 (11:54 +0200)]
bpo-46263: Don't use MULTIARCH on FreeBSD (#30410)
Nikita Sobolev [Wed, 5 Jan 2022 00:11:06 +0000 (03:11 +0300)]
bpo-46262: [Enum] test error path in `Flag._missing_` (GH-30408)
add tests that exercise the `_missing_` error path for `Flag` and `IntFlag`
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Brandt Bucher [Tue, 4 Jan 2022 19:38:32 +0000 (11:38 -0800)]
bpo-46009: Remove GEN_START (GH-30367)
Philipp Claßen [Tue, 4 Jan 2022 18:48:04 +0000 (19:48 +0100)]
Fix missing "," in the documentation of Executor Objects (GH-30404)
Dennis Sweeney [Tue, 4 Jan 2022 18:05:09 +0000 (13:05 -0500)]
bpo-45609: More specialization stats for STORE_SUBSCR (GH-30193)
Kumar Aditya [Tue, 4 Jan 2022 13:36:13 +0000 (19:06 +0530)]
bpo-20369: concurrent.futures.wait() now deduplicates futures given a… (GH-30168)
* bpo-20369: concurrent.futures.wait() now deduplicates futures given as arg.
* 📜🤖 Added by blurb_it.
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Hugo van Kemenade [Tue, 4 Jan 2022 11:34:31 +0000 (13:34 +0200)]
bpo-33252: Document that ResourceWarning is ignored by default (GH-30358)
`ResourceWarning` is ignored by default.
Document this behaviour, for consistency with others in this table such as `DeprecationWarning`.
Documentation PR can skip NEWS file.
Automerge-Triggered-By: GH:iritkatriel
Pablo Galindo Salgado [Tue, 4 Jan 2022 10:42:15 +0000 (10:42 +0000)]
bpo-46231: Remove invalid_* rules preceded by more tokens from the grammar docs (GH-30341)
Pablo Galindo Salgado [Tue, 4 Jan 2022 10:41:22 +0000 (10:41 +0000)]
bpo-46240: Correct the error for unclosed parentheses when the tokenizer is not finished (GH-30378)
Irit Katriel [Tue, 4 Jan 2022 10:37:12 +0000 (10:37 +0000)]
bpo-46202: Remove opcode POP_EXCEPT_AND_RERAISE (GH-30302)
* bpo-46202: remove opcode POP_EXCEPT_AND_RERAISE
* do not assume that an exception group is truthy
Erlend Egeberg Aasland [Tue, 4 Jan 2022 09:36:30 +0000 (10:36 +0100)]
bpo-44092: Move What's New entry to where it belongs (GH-30381)
David Gilbertson [Tue, 4 Jan 2022 09:25:56 +0000 (20:25 +1100)]
Update old-style strings to f-strings (GH-30384)
Let me know if this sort of change is unwanted...
Nikita Sobolev [Tue, 4 Jan 2022 08:44:26 +0000 (11:44 +0300)]
bpo-46239: improve error message when importing `asyncio.windows_events` (GH-30353)
Nikita Sobolev [Tue, 4 Jan 2022 08:42:19 +0000 (11:42 +0300)]
bpo-46238: reuse `_winapi` constants in `asyncio.windows_events` (GH-30352)
Tim Peters [Tue, 4 Jan 2022 02:41:16 +0000 (20:41 -0600)]
bpo-46233: Minor speedup for bigint squaring (GH-30345)
x_mul()'s squaring code can do some redundant and/or useless
work at the end of each digit pass. A more careful analysis
of worst-case carries at various digit positions allows
making that code leaner.
Erlend Egeberg Aasland [Mon, 3 Jan 2022 23:47:16 +0000 (00:47 +0100)]
bpo-44092: Remove unused member `reset` from `sqlite3.Cursor` (GH-30377)
Automerge-Triggered-By: GH:pablogsal
Hugo van Kemenade [Mon, 3 Jan 2022 22:52:09 +0000 (00:52 +0200)]
bpo-34538: Remove Exception subclassing from tutorial (GH-30361)
Remove the bit about subclassing exceptions.
Documentation PR can skip the NEWS label.
Automerge-Triggered-By: GH:iritkatriel
Raymond Hettinger [Mon, 3 Jan 2022 22:26:08 +0000 (14:26 -0800)]
Add doctest and improve readability for move_to_end() example. (#30370)
Irit Katriel [Mon, 3 Jan 2022 20:10:07 +0000 (20:10 +0000)]
bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple leading periods (GH-30347)
Pablo Galindo Salgado [Mon, 3 Jan 2022 19:54:06 +0000 (19:54 +0000)]
Erlend Egeberg Aasland [Mon, 3 Jan 2022 19:02:39 +0000 (20:02 +0100)]
bpo-44092: Don't reset statements/cursors before rollback (GH-26026)
In SQLite versions pre 3.7.11, pending statements would block a rollback. This is no longer the case, so remove the workaround.
Pablo Galindo Salgado [Mon, 3 Jan 2022 18:29:18 +0000 (18:29 +0000)]
Revert "bpo-46110: Add a recursion check to avoid stack overflow in the PEG parser (GH-30177)" (GH-30363)
This reverts commit
e9898bf153d26059261ffef11f7643ae991e2a4c temporarily as we want to confirm if this commit is the cause of a slowdown at startup time.
David CARLIER [Mon, 3 Jan 2022 13:01:04 +0000 (13:01 +0000)]
bpo-46222: posixmodule sendfile FreeBSD's constants updates. (GH-30327)
* posixodule sendfile FreeBSD's constants updates.
* 📜🤖 Added by blurb_it.
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Ned Deily [Mon, 3 Jan 2022 06:19:59 +0000 (01:19 -0500)]
bpo-40477: macOS Python Launcher app fixes for recent macOS releases (GH-30348)
This change solves two problems encountered by users of the macOS Python Launcher app on recent macOS releases (10.14+):
- The launcher app was no longer able to launch the macOS Terminal.app to run a script.
- Even if Terminal.app was already launched, the launcher app was unable to send an Apple Event to Terminal.app to open and run Python with the desired .py file.
Nikita Sobolev [Sun, 2 Jan 2022 23:30:54 +0000 (02:30 +0300)]
bpo-46229: remove `CODE_OF_CONDUCT.md` to use org default (GH-30342)
Automerge-Triggered-By: GH:Mariatta
Irit Katriel [Sun, 2 Jan 2022 23:22:42 +0000 (23:22 +0000)]
bpo-46219, 46221: simplify except* implementation following exc_info changes. Move helpers to exceptions.c. Do not assume that exception groups are truthy. (GH-30289)
Jade Lovelace [Sun, 2 Jan 2022 20:16:25 +0000 (12:16 -0800)]
argparse docs: prog default is the basename of argv[0] (GH-30298)
Benjamin Peterson [Sun, 2 Jan 2022 20:08:48 +0000 (14:08 -0600)]
Update copyright year to 2022. (GH-30335)
Automerge-Triggered-By: GH:benjaminp
Tim Peters [Sun, 2 Jan 2022 19:18:20 +0000 (13:18 -0600)]
bpo-46218: Change long_pow() to sliding window algorithm (GH-30319)
* bpo-46218: Change long_pow() to sliding window algorithm
The primary motivation is to eliminate long_pow's reliance on that the number of bits in a long "digit" is a multiple of 5. Now it no longer cares how many bits are in a digit.
But the sliding window approach also allows cutting the precomputed table of small powers in half, which reduces initialization overhead enough that the approach pays off for smaller exponents too. Depending on exponent bit patterns, a sliding window may also be able to save some bigint multiplies (sometimes when at least 5 consecutive exponent bits are 0, regardless of their starting bit position modulo 5).
Note: boosting the window width to 6 didn't work well overall. It give marginal speed improvements for huge exponents, but the increased overhead (the small-power table needs twice as many entries) made it a loss for smaller exponents.
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>
Nikita Sobolev [Sun, 2 Jan 2022 18:33:20 +0000 (21:33 +0300)]
bpo-46196: document method cmd.Cmd.columnize (#30303)
The method is already written and tested, now it's officially public.