This is an actual python object. It consists of a typ which is the
python class, and carries some rust payload optionally. This rust
payload can be a rust float or rust int in case of float and int objects.
Atomic borrowed (non-ref-counted) optional reference to a Python object.
Unlike PyAtomicRef, this does NOT own the reference.
The pointed-to object must outlive this reference.
The PyObjectRef is one of the most used types. It is a reference to a
python object. A single python object can have multiple references, and
this reference counting is accounted for by this type. Use the .clone()
method to create a new reference and increment the amount of references
to the python object by 1.
Native subclasses declared with #[pyclass(base = Base)] share the base’s
payload type ID. Their base field must start at offset zero, and their
payload must start at the same offset inside Py<T> as the base payload.
The derived object must also meet the base object’s alignment requirement.
The macro checks these conditions at compile time. repr(C) on the payload
alone does not guarantee the second condition:
Use this type for functions which return a python object or an exception.
Both the python object and the python exception are PyObjectRef types
since exceptions are also python objects.