What is a PyObject in Python?

前端 未结 2 1224
醉话见心
醉话见心 2021-01-17 07:30

Short version

I recently came across some Python code in which the return type for a function was specified as PyObject in the document

2条回答
  •  爱一瞬间的悲伤
    2021-01-17 07:49

    A PyObject is in fact just a Python object at the C level. And since integers in Python are objects, they are also PyObjects. It doesn't matter whether it was written in Python or in C, it is a PyObject at the C level regardless.

提交回复
热议问题