Python Basic Objects Learning Notes
Recently revisiting the book “Python Source Code Analysis”, I’ve recorded the key points about Python basic objects as follows:
Python Integer Objects
- Python integers use C language’s long type for storage
- Python int addition checks if the result overflows, and automatically converts to pyLongObject if it does
- Documentation in Python is seamlessly integrated into the language implementation
|
|
-
Small integer objects are completely cached in memory, other integer objects take turns using a block of memory space
|