mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
GH-91432: Specialize FOR_ITER (GH-91713)
* Adds FOR_ITER_LIST and FOR_ITER_RANGE specializations. * Adds _PyLong_AssignValue() internal function to avoid temporary boxing of ints.
This commit is contained in:
parent
c735d54534
commit
5fcfdd87c9
22 changed files with 447 additions and 282 deletions
22
Include/internal/pycore_range.h
Normal file
22
Include/internal/pycore_range.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef Py_INTERNAL_RANGE_H
|
||||
#define Py_INTERNAL_RANGE_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
long index;
|
||||
long start;
|
||||
long step;
|
||||
long len;
|
||||
} _PyRangeIterObject;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !Py_INTERNAL_RANGE_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue