cython

Форк
0
52 строки · 2.0 Кб
1

2
cdef extern from "Python.h":
3
    # The C structure of the objects used to describe built-in types.
4

5
    ############################################################################
6
    # 7.1.1 Type Objects
7
    ############################################################################
8

9
    ctypedef class __builtin__.type [object PyTypeObject]:
10
        pass
11

12
    # PyObject* PyType_Type
13
    # This is the type object for type objects; it is the same object
14
    # as type and types.TypeType in the Python layer.
15

16
    bint PyType_Check(object o)
17
    # Return true if the object o is a type object, including
18
    # instances of types derived from the standard type object. Return
19
    # false in all other cases.
20

21
    bint PyType_CheckExact(object o)
22
    # Return true if the object o is a type object, but not a subtype
23
    # of the standard type object. Return false in all other
24
    # cases.
25

26
    void PyType_Modified(type type)
27
    # Invalidate the internal lookup cache for the type and all of its
28
    # subtypes. This function must be called after any manual modification
29
    # of the attributes or base classes of the type.
30

31
    bint PyType_HasFeature(object o, int feature)
32
    # Return true if the type object o sets the feature feature. Type
33
    # features are denoted by single bit flags.
34

35
    bint PyType_IS_GC(object o)
36
    # Return true if the type object includes support for the cycle
37
    # detector; this tests the type flag Py_TPFLAGS_HAVE_GC.
38

39
    bint PyType_IsSubtype(type a, type b)
40
    # Return true if a is a subtype of b.
41

42
    object PyType_GenericAlloc(object type, Py_ssize_t nitems)
43
    # Return value: New reference.
44

45
    object PyType_GenericNew(type type, object args, object kwds)
46
    # Return value: New reference.
47

48
    bint PyType_Ready(type type) except -1
49
    # Finalize a type object. This should be called on all type
50
    # objects to finish their initialization. This function is
51
    # responsible for adding inherited slots from a type's base
52
    # class. Return 0 on success, or return -1 and sets an exception
53
    # on error.
54

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.