cpython/Include/internal/pycore_lazyimportobject.h

37 lines
990 B
C
Raw Normal View History

2025-09-16 15:10:28 -07:00
/* File added for Lazy Imports */
/* Lazy object interface */
#ifndef Py_INTERNAL_LAZYIMPORTOBJECT_H
#define Py_INTERNAL_LAZYIMPORTOBJECT_H
2025-09-16 15:10:28 -07:00
#ifdef __cplusplus
extern "C" {
#endif
#ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif
2025-09-16 15:10:28 -07:00
PyAPI_DATA(PyTypeObject) PyLazyImport_Type;
#define PyLazyImport_CheckExact(op) Py_IS_TYPE((op), &PyLazyImport_Type)
typedef struct {
PyObject_HEAD
PyObject *lz_builtins;
2025-09-16 15:10:28 -07:00
PyObject *lz_from;
PyObject *lz_attr;
2025-09-23 00:02:27 +01:00
/* Frame information for the original import location */
PyCodeObject *lz_code; /* code object where the lazy import was created */
int lz_instr_offset; /* instruction offset where the lazy import was created */
2025-09-16 15:10:28 -07:00
} PyLazyImportObject;
PyAPI_FUNC(PyObject *) _PyLazyImport_GetName(PyObject *lazy_import);
PyAPI_FUNC(PyObject *) _PyLazyImport_New(PyObject *import_func, PyObject *from, PyObject *attr);
2025-09-16 15:10:28 -07:00
#ifdef __cplusplus
}
#endif
#endif /* !Py_INTERNAL_LAZYIMPORTOBJECT_H */