Object Protocol — Python 3.11.16 documentation

docs.python.org

Tin mới

Abstract Objects Layer

Python Module Index

3.11.16 Documentation

Python/C API Reference Manual

PyFile_WriteObject()

Flag to be used with multiple functions that print the object (like PyObject_Print() and PyFile_WriteObject()). If passed, these function would use the str() of the object instead of the repr().

object.__getattr__

Exceptions that occur when this calls __getattr__() and __getattribute__() methods are silently ignored. For proper error handling, use PyObject_GetAttr() instead.

PyTypeObject.tp_setattro

instance.__class__

Return 1 if inst is an instance of the class cls or a subclass of cls, or 0 if not. On error, returns -1 and sets an exception.