code.h 929 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef Py_CODE_H
  2. #define Py_CODE_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. typedef struct {
  7. PyObject_HEAD
  8. PyObject *co_name;
  9. PyObject *co_filename;
  10. int co_argcount;
  11. int co_flags;
  12. } PyCodeObject;
  13. /* Masks for co_flags above */
  14. /* These values are also in funcobject.py */
  15. #define CO_OPTIMIZED 0x0001
  16. #define CO_NEWLOCALS 0x0002
  17. #define CO_VARARGS 0x0004
  18. #define CO_VARKEYWORDS 0x0008
  19. #define CO_NESTED 0x0010
  20. #define CO_GENERATOR 0x0020
  21. /* The CO_COROUTINE flag is set for coroutine functions (defined with
  22. ``async def`` keywords) */
  23. #define CO_COROUTINE 0x0080
  24. #define CO_ITERABLE_COROUTINE 0x0100
  25. #define CO_FUTURE_DIVISION 0x02000
  26. #define CO_FUTURE_ABSOLUTE_IMPORT 0x04000
  27. #define CO_FUTURE_WITH_STATEMENT 0x08000
  28. #define CO_FUTURE_PRINT_FUNCTION 0x10000
  29. #define CO_FUTURE_UNICODE_LITERALS 0x20000
  30. #ifdef __cplusplus
  31. }
  32. #endif
  33. #endif /* !Py_CODE_H */