Re:Javascript-Style Objects in Python
by jpetersonmn on Monday March 16, 2015 @01:12PM
(#9212744)
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.
[ Parent
| on HN ]
No, 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.