From Programming Language Pragmatics, by Scott
Object lifetimes generally correspond to one of three principal storage allocation mechanisms, used to manage the object’s space:
Static objects are given an absolute address that is retained throughout the program’s execution.
Stack objects are allocated and deallocated in last-in, first-out order, usually in conjunction with subroutine calls and returns.
Heap objects may be allocated and deallocated at arbitrary times. They require a more general (and expensive) storage management algorithm.
The C programming language has static objects, stack objects and heap objects.
Does Python have static objects, stack objects and heap objects?
I saw in another post that CPython allocate all objects on the heap. Does it mean that all the objects in Python are heap objects?
But Python also has static methods. Are static methods in Python static objects in the PLP book?
Thanks.
Python objects are mostly heap objects - however, there are some special PyObject singleton values in CPython that are static in C; though this is an implementation detail. For example the usual built-in types have static storage duration. There are no stack (Python) objects that I know of.
The static storage duration, as understood here, has absolutely nothing to do with static methods.