pycore_abstract.h 611 B

12345678910111213141516171819202122232425
  1. #ifndef Py_INTERNAL_ABSTRACT_H
  2. #define Py_INTERNAL_ABSTRACT_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #ifndef Py_BUILD_CORE
  7. # error "this header requires Py_BUILD_CORE define"
  8. #endif
  9. // Fast inlined version of PyIndex_Check()
  10. static inline int
  11. _PyIndex_Check(PyObject *obj)
  12. {
  13. PyNumberMethods *tp_as_number = Py_TYPE(obj)->tp_as_number;
  14. return (tp_as_number != NULL && tp_as_number->nb_index != NULL);
  15. }
  16. PyObject *_PyNumber_PowerNoMod(PyObject *lhs, PyObject *rhs);
  17. PyObject *_PyNumber_InPlacePowerNoMod(PyObject *lhs, PyObject *rhs);
  18. #ifdef __cplusplus
  19. }
  20. #endif
  21. #endif /* !Py_INTERNAL_ABSTRACT_H */