Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
Open
Description
In Python 2int
s andlong
s were different objects, and the design of each was tailored to the different size and use cases.
In Python3 we dropped the distinction, but we also dropped the design forint
s that fit into a single word.
We have added various fast paths for "medium" integers (e.g.#89109) but the underlying data structure gets in the way.
We should layout the int/long object so that it supports fast operations for most integers.
Seefaster-cpython/ideas#548 for a fuller discussion
Linked PRs
- GH-101291: Refactor the
PyLongObject
struct #101292 - GH-101291: Low level opt-in API for pylong #101685
- GH-101291: Rearrange the size bits in PyLongObject #102464
- GH-101291: Avoid using macros with casts in low-level long API. #104742
- [3.12] GH-101291: Avoid using macros with casts in low-level long API. (GH-104742) #104759
- GH-101291: Add warning to "what's new" that
PyLongObject
internals have changed. #107388 - [3.12] GH-101291: Add warning to "what's new" that
PyLongObject
internals have changed. (GH-107388) #107392 - gh-101291: Add versionadded directives for PyUnstable_Long_* #125384
- [3.13] gh-101291: Add versionadded directives for PyUnstable_Long_* (GH-125384) #125407
- [3.12] gh-101291: Add versionadded directives for PyUnstable_Long_* (GH-125384) #125408