64. Defining New Types
64. Defining New Types A CPython extension module can expose new Python types implemented in C. These types behave like normal Python classes from user code, but their memory layout, allocation, methods, attribute access, numeric operations, sequence operations, and deallocation logic are controlled by C structures and function pointers. A built-in type such as list , dict , int , or str is implemented this way. Extension modules can use...