2 ms·
One way to think about object instances is that they are namespaces full of partially applied functions, the applied argument being `this` or `self`; Python mak
by nine_k 6y ago
One way to think about object instances is that they are namespaces full of partially applied functions, the applied argument being `this` or `self`; Python makes it excessively obvious.
The function that produces these namespaces is usually the `new` operator, its argument, the "constructor", just allows to set up the common partially applied value (and run arbitrary code along the way).
This partial application is not a serious problem; the mutability and the inheritance are.