4 ms·
For those that didn't see, the original title of this post was "Why use classes at all in python" and not what it is now. Apparently the author thought a dictio
by jpetersonmn 12y ago
For those that didn't see, the original title of this post was "Why use classes at all in python" and not what it is now. Apparently the author thought a dictionary was as useful and could do anything a class object can.
- eatonphil 12y agoNo, I think a closure is as useful and can do anything a "class object" can... What exactly do you think a class can do that you can't replicate in this pattern? Inheritance? Pass the parent function in. Typeof? Store a type value or get the function name reflectively.