PyFunctionObject#
- class einspect.structs.py_function.PyFunctionObject(__obj: Union[_T, PyObject[_T, _KT, _VT]])#
- class einspect.structs.py_function.PyFunctionObject(*, ob_refcnt: int = 1, ob_type: LP_PyTypeObject, **kwargs)
-
- as_ref()#
Return a pointer to the Structure.
- Return type:
<object object at 0x7fd11384d530>
- astype(dtype)#
Cast the PyObject into another PyObject type.
- Return type:
TypeVar
(_ST
, bound=Structure
)
- classmethod from_gc(gc)#
Create a PyObject from a PyGC_Head struct.
- Return type:
Self
- classmethod from_object(obj)#
Create a PyObject from an object.
- Return type:
Self
- gc_may_be_tracked()#
Return True if the PyObject may be tracked by the GC in the future, or already is.
https://github.com/python/cpython/blob/3.11/Include/internal/pycore_gc.h#L28-L32
- Return type:
- instance_dict()#
Return the instance dict of the PyObject.
An offset override can be set by __st_dictoffset__. It should be relative to the address of the PyObject.
https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_dictoffset
- Return type:
Optional
[LP_PyObject
]
- is_gc()#
Returns True if the object implements the GC protocol.
The object cannot be tracked by the garbage collector if False.
https://github.com/python/cpython/blob/3.11/Include/internal/pycore_object.h#L209-L216
- Return type:
- classmethod try_from(obj_or_ptr)#
Create a PyObject from a PyObject, pointer to a PyObject, or object.
- Return type:
Self
- with_ref(n=1)#
Increment the reference count of the PyObject by n. Return self.
- Return type:
Self