| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
gh-95302 seems to have introduced a small performance regression. Here we make some minor changes to recover that lost performance.
|
| |
|
|
|
|
| |
(GH-95278)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Store tp_weaklist on the interpreter state for static builtin types.
* Factor out _PyStaticType_GET_WEAKREFS_LISTPTR().
* Add _PyStaticType_ClearWeakRefs().
* Add a comment about how _PyStaticType_ClearWeakRefs() loops.
* Document the change.
* Update Doc/whatsnew/3.12.rst
* Fix a typo.
|
| |
|
|
|
| |
Co-authored-by: Brett Cannon <brett@python.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the last precursor to storing tp_subclasses (and tp_weaklist) on the interpreter state for static builtin types.
Here we add per-type storage on PyInterpreterState, but only for the static builtin types. This involves the following:
* add PyInterpreterState.types
* move PyInterpreterState.type_cache to it
* add a "num_builtins_initialized" field
* add a "builtins" field (a static array big enough for all the static builtin types)
* add _PyStaticType_GetState() to look up a static builtin type's state
* (temporarily) add PyTypeObject.tp_static_builtin_index (to hold the type's index into PyInterpreterState.types.builtins)
We will be eliminating tp_static_builtin_index in a later change.
|
|
|
|
|
|
|
| |
* Add _Py_memory_repeat function to pycore_list
* Add _Py_RefcntAdd function to pycore_object
* Use the new functions in tuplerepeat, list_repeat, and list_inplace_repeat
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the first of several precursors to storing tp_subclasses (and tp_weaklist) on the interpreter state for static builtin types.
We do the following:
* add `_PyStaticType_InitBuiltin()`
* add `_Py_TPFLAGS_STATIC_BUILTIN`
* set it on all static builtin types in `_PyStaticType_InitBuiltin()`
* shuffle some code around to be able to use _PyStaticType_InitBuiltin()
* rename `_PyStructSequence_InitType()` to `_PyStructSequence_InitBuiltinWithFlags()`
* add `_PyStructSequence_InitBuiltin()`.
|
| |
|
|
|
| |
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
| |
frame.f_lineno in the debugger. (GH-94958)
|
|
|
| |
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
|
|
|
|
| |
GH-31527 moved this typedef to `Include/pytypedefs.h`, so this comment
should point at the correct location
|
|
|
| |
This is similar to how strings are interned for deepfreeze.
|
|
|
|
| |
(GH-94051)
|
| |
|
|
|
|
| |
(GH-94371)
|
|
|
|
| |
750 fails sometimes with newer wasmtime versions. 600 is a more
conservative value.
|
| |
|
|
|
|
|
| |
Don't add parenthesis around the type parameter.
Add unit tests on PyObject_NEW() and similar functions.
|
|
|
| |
Sync up co_code changes with 3.11 commit 852b4d4bcd12b0b6839a015a262ce976b134f6f3.
|
|
|
|
| |
runtime. (GH-93843)
|
|
|
|
|
| |
* Adds FOR_ITER_LIST and FOR_ITER_RANGE specializations.
* Adds _PyLong_AssignValue() internal function to avoid temporary boxing of ints.
|
|
|
| |
Add unit test on Py_MEMBER_SIZE() and some other macros.
|
|
|
|
| |
* Use a lookup table to reduce overhead of getting line numbers during tracing.
|
|
|
|
| |
on thread frame stack. (GH-93908)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the follow functions and type from frameobject.h to pyframe.h,
so the standard <Python.h> provide frame getter functions:
* PyFrame_Check()
* PyFrame_GetBack()
* PyFrame_GetBuiltins()
* PyFrame_GetGenerator()
* PyFrame_GetGlobals()
* PyFrame_GetLasti()
* PyFrame_GetLocals()
* PyFrame_Type
Remove #include "frameobject.h" from many C files. It's no longer
needed.
|
| |
|
|
|
|
|
|
|
| |
Deprecate global configuration variable like
Py_IgnoreEnvironmentFlag: the Py_InitializeFromConfig() API should be
instead.
Fix declaration of Py_GETENV(): use PyAPI_FUNC(), not PyAPI_DATA().
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Fix the compatibility of the Python C API with C++ older than C++11.
_Py_NULL is only defined as nullptr on C++11 and newer.
|
|
|
|
|
|
| |
It combines PyImport_ImportModule() and PyObject_GetAttrString()
and saves 4-6 lines of code on every use.
Add also _PyImport_GetModuleAttr() which takes Python strings as arguments.
|
|
|
|
| |
Header files in the Include/cpython/ are only included if
the Py_LIMITED_API macro is not defined.
|
|
|
|
| |
UB (GH-93700)
|
|
|
| |
The macro was exposed by mistake.
|
|
|
| |
Convert PyFunction macros to static inline functions.
|
| |
|
|
|
|
|
|
|
|
|
| |
and TypeVarTuple parameters (alt) (GH-93412)
For example:
A[T, *Ts][*tuple[int, ...]] -> A[int, *tuple[int, ...]]
A[*Ts, T][*tuple[int, ...]] -> A[*tuple[int, ...], int]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add C++ overloads for _Py_CAST_impl() to handle 0/NULL. This will allow
C++ extensions that pass 0 or NULL to macros using _Py_CAST() to
continue to compile. Without this, you get an error like:
invalid ‘static_cast’ from type ‘int’ to type ‘_object*’
The modern way to use a NULL value in C++ is to use nullptr. However,
we want to not break extensions that do things the old way.
Co-authored-by: serge-sans-paille
|
|
|
|
| |
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
|
|
|
|
| |
Use _PyObject_CAST() in the public C API to fix C++ compiler
warnings: "use of old-style cast" (clang -Wold-style-cast).
|