$89 GRAYBYTE WORDPRESS FILE MANAGER $15

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.160.161 | ADMIN IP 216.73.217.61
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/python313/include/python3.13/internal/

HOME
Current File : /opt/alt/python313/include/python3.13/internal//pycore_typeobject.h
#ifndef Py_INTERNAL_TYPEOBJECT_H
#define Py_INTERNAL_TYPEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif

#ifndef Py_BUILD_CORE
#  error "this header requires Py_BUILD_CORE define"
#endif

#include "pycore_moduleobject.h"  // PyModuleObject
#include "pycore_lock.h"          // PyMutex


/* state */

#define _Py_TYPE_BASE_VERSION_TAG (2<<16)
#define _Py_MAX_GLOBAL_TYPE_VERSION_TAG (_Py_TYPE_BASE_VERSION_TAG - 1)

/* For now we hard-code this to a value for which we are confident
   all the static builtin types will fit (for all builds). */
#define _Py_MAX_MANAGED_STATIC_BUILTIN_TYPES 200
#define _Py_MAX_MANAGED_STATIC_EXT_TYPES 10
#define _Py_MAX_MANAGED_STATIC_TYPES \
    (_Py_MAX_MANAGED_STATIC_BUILTIN_TYPES + _Py_MAX_MANAGED_STATIC_EXT_TYPES)

struct _types_runtime_state {
    /* Used to set PyTypeObject.tp_version_tag for core static types. */
    // bpo-42745: next_version_tag remains shared by all interpreters
    // because of static types.
    unsigned int next_version_tag;

    struct {
        struct {
            PyTypeObject *type;
            int64_t interp_count;
        } types[_Py_MAX_MANAGED_STATIC_TYPES];
    } managed_static;
};


// Type attribute lookup cache: speed up attribute and method lookups,
// see _PyType_Lookup().
struct type_cache_entry {
    unsigned int version;  // initialized from type->tp_version_tag
#ifdef Py_GIL_DISABLED
   _PySeqLock sequence;
#endif
    PyObject *name;        // reference to exactly a str or None
    PyObject *value;       // borrowed reference or NULL
};

#define MCACHE_SIZE_EXP 12

struct type_cache {
    struct type_cache_entry hashtable[1 << MCACHE_SIZE_EXP];
};

typedef struct {
    PyTypeObject *type;
    int isbuiltin;
    int readying;
    int ready;
    // XXX tp_dict can probably be statically allocated,
    // instead of dynamically and stored on the interpreter.
    PyObject *tp_dict;
    PyObject *tp_subclasses;
    /* We never clean up weakrefs for static builtin types since
       they will effectively never get triggered.  However, there
       are also some diagnostic uses for the list of weakrefs,
       so we still keep it. */
    PyObject *tp_weaklist;
} managed_static_type_state;

struct types_state {
    /* Used to set PyTypeObject.tp_version_tag.
       It starts at _Py_MAX_GLOBAL_TYPE_VERSION_TAG + 1,
       where all those lower numbers are used for core static types. */
    unsigned int next_version_tag;

    struct type_cache type_cache;

    /* Every static builtin type is initialized for each interpreter
       during its own initialization, including for the main interpreter
       during global runtime initialization.  This is done by calling
       _PyStaticType_InitBuiltin().

       The first time a static builtin type is initialized, all the
       normal PyType_Ready() stuff happens.  The only difference from
       normal is that there are three PyTypeObject fields holding
       objects which are stored here (on PyInterpreterState) rather
       than in the corresponding PyTypeObject fields.  Those are:
       tp_dict (cls.__dict__), tp_subclasses (cls.__subclasses__),
       and tp_weaklist.

       When a subinterpreter is initialized, each static builtin type
       is still initialized, but only the interpreter-specific portion,
       namely those three objects.

       Those objects are stored in the PyInterpreterState.types.builtins
       array, at the index corresponding to each specific static builtin
       type.  That index (a size_t value) is stored in the tp_subclasses
       field.  For static builtin types, we re-purposed the now-unused
       tp_subclasses to avoid adding another field to PyTypeObject.
       In all other cases tp_subclasses holds a dict like before.
       (The field was previously defined as PyObject*, but is now void*
       to reflect its dual use.)

       The index for each static builtin type isn't statically assigned.
       Instead it is calculated the first time a type is initialized
       (by the main interpreter).  The index matches the order in which
       the type was initialized relative to the others.  The actual
       value comes from the current value of num_builtins_initialized,
       as each type is initialized for the main interpreter.

       num_builtins_initialized is incremented once for each static
       builtin type.  Once initialization is over for a subinterpreter,
       the value will be the same as for all other interpreters.  */
    struct {
        size_t num_initialized;
        managed_static_type_state initialized[_Py_MAX_MANAGED_STATIC_BUILTIN_TYPES];
    } builtins;
    /* We apply a similar strategy for managed extension modules. */
    struct {
        size_t num_initialized;
        size_t next_index;
        managed_static_type_state initialized[_Py_MAX_MANAGED_STATIC_EXT_TYPES];
    } for_extensions;
    PyMutex mutex;
};


/* runtime lifecycle */

extern PyStatus _PyTypes_InitTypes(PyInterpreterState *);
extern void _PyTypes_FiniTypes(PyInterpreterState *);
extern void _PyTypes_FiniExtTypes(PyInterpreterState *interp);
extern void _PyTypes_Fini(PyInterpreterState *);
extern void _PyTypes_AfterFork(void);

/* other API */

/* Length of array of slotdef pointers used to store slots with the
   same __name__.  There should be at most MAX_EQUIV-1 slotdef entries with
   the same __name__, for any __name__. Since that's a static property, it is
   appropriate to declare fixed-size arrays for this. */
#define MAX_EQUIV 10

typedef struct wrapperbase pytype_slotdef;


static inline PyObject **
_PyStaticType_GET_WEAKREFS_LISTPTR(managed_static_type_state *state)
{
    assert(state != NULL);
    return &state->tp_weaklist;
}

extern int _PyStaticType_InitBuiltin(
    PyInterpreterState *interp,
    PyTypeObject *type);
extern void _PyStaticType_FiniBuiltin(
    PyInterpreterState *interp,
    PyTypeObject *type);
extern void _PyStaticType_ClearWeakRefs(
    PyInterpreterState *interp,
    PyTypeObject *type);
extern managed_static_type_state * _PyStaticType_GetState(
    PyInterpreterState *interp,
    PyTypeObject *type);

// Export for '_datetime' shared extension.
PyAPI_FUNC(int) _PyStaticType_InitForExtension(
    PyInterpreterState *interp,
     PyTypeObject *self);


/* Like PyType_GetModuleState, but skips verification
 * that type is a heap type with an associated module */
static inline void *
_PyType_GetModuleState(PyTypeObject *type)
{
    assert(PyType_Check(type));
    assert(type->tp_flags & Py_TPFLAGS_HEAPTYPE);
    PyHeapTypeObject *et = (PyHeapTypeObject *)type;
    assert(et->ht_module);
    PyModuleObject *mod = (PyModuleObject *)(et->ht_module);
    assert(mod != NULL);
    return mod->md_state;
}


// Export for 'math' shared extension, used via _PyType_IsReady() static inline
// function
PyAPI_FUNC(PyObject *) _PyType_GetDict(PyTypeObject *);

extern PyObject * _PyType_GetBases(PyTypeObject *type);
extern PyObject * _PyType_GetMRO(PyTypeObject *type);
extern PyObject* _PyType_GetSubclasses(PyTypeObject *);
extern int _PyType_HasSubclasses(PyTypeObject *);
PyAPI_FUNC(PyObject *) _PyType_GetModuleByDef2(PyTypeObject *, PyTypeObject *, PyModuleDef *);
PyAPI_FUNC(PyObject *) _PyType_GetModuleByDef3(PyTypeObject *, PyTypeObject *, PyTypeObject *, PyModuleDef *);

// PyType_Ready() must be called if _PyType_IsReady() is false.
// See also the Py_TPFLAGS_READY flag.
static inline int
_PyType_IsReady(PyTypeObject *type)
{
    return _PyType_GetDict(type) != NULL;
}

extern PyObject* _Py_type_getattro_impl(PyTypeObject *type, PyObject *name,
                                        int *suppress_missing_attribute);
extern PyObject* _Py_type_getattro(PyObject *type, PyObject *name);

extern PyObject* _Py_BaseObject_RichCompare(PyObject* self, PyObject* other, int op);

extern PyObject* _Py_slot_tp_getattro(PyObject *self, PyObject *name);
extern PyObject* _Py_slot_tp_getattr_hook(PyObject *self, PyObject *name);

extern PyTypeObject _PyBufferWrapper_Type;

PyAPI_FUNC(PyObject*) _PySuper_Lookup(PyTypeObject *su_type, PyObject *su_obj,
                                 PyObject *name, int *meth_found);

extern PyObject* _PyType_GetFullyQualifiedName(PyTypeObject *type, char sep);

// Perform the following operation, in a thread-safe way when required by the
// build mode.
//
// self->tp_flags = (self->tp_flags & ~mask) | flags;
extern void _PyType_SetFlags(PyTypeObject *self, unsigned long mask,
                             unsigned long flags);
extern int _PyType_AddMethod(PyTypeObject *, PyMethodDef *);

// Like _PyType_SetFlags(), but apply the operation to self and any of its
// subclasses without Py_TPFLAGS_IMMUTABLETYPE set.
extern void _PyType_SetFlagsRecursive(PyTypeObject *self, unsigned long mask,
                                      unsigned long flags);


#ifdef __cplusplus
}
#endif
#endif /* !Py_INTERNAL_TYPEOBJECT_H */


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
23 May 2026 8.41 AM
root / linksafe
0755
mimalloc
--
23 May 2026 8.41 AM
root / linksafe
0755
pycore_abstract.h
1.87 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_asdl.h
2.964 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_ast.h
30.781 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_ast_state.h
6.62 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_atexit.h
1.399 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_backoff.h
3.887 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_bitutils.h
5.885 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_blocks_output_buffer.h
8.566 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_brc.h
2.053 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_bytes_methods.h
3.841 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_bytesobject.h
4.979 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_call.h
5.991 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_capsule.h
0.388 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_cell.h
1.032 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_ceval.h
11.117 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_ceval_state.h
3.941 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_code.h
19.785 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_codecs.h
2.407 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_compile.h
3.662 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_complexobject.h
0.574 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_condvar.h
2.641 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_context.h
1.154 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_critical_section.h
7.781 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_crossinterp.h
11.844 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_descrobject.h
0.53 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_dict.h
11.977 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_dict_state.h
0.715 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_dtoa.h
1.687 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_emscripten_signal.h
0.669 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_emscripten_trampoline.h
3.105 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_exceptions.h
0.879 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_faulthandler.h
2.192 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_fileutils.h
9.246 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_fileutils_windows.h
2.649 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_floatobject.h
1.46 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_flowgraph.h
1.454 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_format.h
0.469 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_frame.h
12.075 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_freelist.h
4.697 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_function.h
1.502 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_gc.h
12.663 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_genobject.h
0.839 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_getopt.h
0.479 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_gil.h
2.145 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_global_objects.h
3.018 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_global_objects_fini_generated.h
115.043 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_global_strings.h
26.08 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_hamt.h
3.654 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_hashtable.h
4.259 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_identifier.h
0.503 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_import.h
7.55 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_importdl.h
3.96 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_initconfig.h
6.226 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_instruction_sequence.h
2.11 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_instruments.h
2.276 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_interp.h
14.72 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_intrinsics.h
1.715 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_jit.h
0.515 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_list.h
1.815 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_llist.h
2.363 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_lock.h
8.338 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_long.h
10.451 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_memoryobject.h
0.417 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_mimalloc.h
1.599 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_modsupport.h
3.272 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_moduleobject.h
1.535 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_namespace.h
0.425 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_object.h
27.281 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_object_alloc.h
2.125 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_object_stack.h
2.328 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_object_state.h
0.92 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_obmalloc.h
26.775 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_obmalloc_init.h
1.89 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_opcode_metadata.h
82.885 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_opcode_utils.h
2.072 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_optimizer.h
8.108 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_parking_lot.h
3.272 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_parser.h
2.04 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_pathconfig.h
0.643 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_pyarena.h
2.795 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_pyatomic_ft_wrappers.h
7.867 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_pybuffer.h
0.498 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_pyerrors.h
4.844 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_pyhash.h
2.747 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_pylifecycle.h
4.36 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_pymath.h
8.398 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_pymem.h
5.24 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_pymem_init.h
3.438 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_pystate.h
9.73 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_pystats.h
0.41 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_pythonrun.h
0.74 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_pythread.h
5.947 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_qsbr.h
5.395 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_range.h
0.338 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_runtime.h
12.856 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_runtime_init.h
12.739 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_runtime_init_generated.h
45.723 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_semaphore.h
1.69 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_setobject.h
0.929 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_signal.h
2.862 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_sliceobject.h
0.36 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_stackref.h
5.064 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_strhex.h
0.989 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_structseq.h
0.94 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_symtable.h
8.468 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_sysmodule.h
1.149 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_time.h
11.518 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_token.h
2.931 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_traceback.h
3.544 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_tracemalloc.h
4.427 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_tstate.h
1.322 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_tuple.h
0.801 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_typeobject.h
8.669 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_typevarobject.h
0.902 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_ucnhash.h
0.936 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_unicodeobject.h
12.959 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_unicodeobject_generated.h
129.043 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_unionobject.h
0.725 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_uop_ids.h
10.064 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_uop_metadata.h
38.719 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_warnings.h
0.82 KB
7 Apr 2026 6.19 PM
root / linksafe
0644
pycore_weakref.h
3.798 KB
7 Apr 2026 6.19 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF