Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

classobject.h 1.6 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
  1. /* Former class object interface -- now only bound methods are here */
  2. /* Revealing some structures (not for general use) */
  3. #ifndef Py_LIMITED_API
  4. #ifndef Py_CLASSOBJECT_H
  5. #define Py_CLASSOBJECT_H
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. typedef struct {
  10. PyObject_HEAD
  11. PyObject *im_func; /* The callable object implementing the method */
  12. PyObject *im_self; /* The instance it is bound to */
  13. PyObject *im_weakreflist; /* List of weak references */
  14. } PyMethodObject;
  15. PyAPI_DATA(PyTypeObject) PyMethod_Type;
  16. #define PyMethod_Check(op) ((op)->ob_type == &PyMethod_Type)
  17. PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *);
  18. PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *);
  19. PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);
  20. /* Macros for direct access to these values. Type checks are *not*
  21. done, so use with care. */
  22. #define PyMethod_GET_FUNCTION(meth) \
  23. (((PyMethodObject *)meth) -> im_func)
  24. #define PyMethod_GET_SELF(meth) \
  25. (((PyMethodObject *)meth) -> im_self)
  26. PyAPI_FUNC(int) PyMethod_ClearFreeList(void);
  27. typedef struct {
  28. PyObject_HEAD
  29. PyObject *func;
  30. } PyInstanceMethodObject;
  31. PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type;
  32. #define PyInstanceMethod_Check(op) ((op)->ob_type == &PyInstanceMethod_Type)
  33. PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *);
  34. PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *);
  35. /* Macros for direct access to these values. Type checks are *not*
  36. done, so use with care. */
  37. #define PyInstanceMethod_GET_FUNCTION(meth) \
  38. (((PyInstanceMethodObject *)meth) -> func)
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42. #endif /* !Py_CLASSOBJECT_H */
  43. #endif /* Py_LIMITED_API */
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...