2 ms·
Just to correct one point from that post: you can close the list of members of a class using __slots__ http://docs.python.org/reference/datamodel.html#slots htt
by viraptor 17y ago
Just to correct one point from that post: you can close the list of members of a class using __slots__ http://docs.python.org/reference/datamodel.html#slots http://docs.python.org/reference/datamodel.html#slots
I really like the "Classes in Python are more like dictionary objects with functions attached than classes." part though. It's exactly what I expect from objects. There aren't that many situations when we need anything more.
- megamark16 17y agoPlus it reminds me of coding javascript, which I have only recently gained a great appreciation for. I love how everything is an Object (even functions), and Objects are just dictionaries. It's awesome.
- mbreese 17y agoClasses in Python are more like dictionary objects Yeah, that was my favorite part... my response was "yes... yes they are." Everything else with classes just seems to be syntactic sugar. I'm not saying that is good or bad, but in Python, just about everything is a dict.