IRC Logs for #circuits Tuesday, 2015-07-07

*** Coldblackice_ has quit IRC15:09
y0nospaceone, what is the puurpose of using __slots__ on _State class ?16:18
y0noI just saw that on stack overflow: https://stackoverflow.com/questions/472000/python-slots16:19
*** robert_ has joined #circuits18:32
*** robert_ has quit IRC18:32
*** robert_ has joined #circuits18:32
prologicy0no, prevents other attributes from every being defined20:06
prologicrestricts the amount of memory an object can consume/occupy20:06
prologicit's cheaper on memory usage20:06
*** robert_ has quit IRC20:08
*** robert_ has joined #circuits20:11
*** robert_ has quit IRC20:11
*** robert_ has joined #circuits20:11
*** Coldblackice has joined #circuits20:52
y0noprologic, it seems to be a bad idea to use __slots__ to prevents attributes being defined according to the SO thread I have shared. I don't know __slots__ so I don't have a real opinion. Do you think they wrote stupidity on the thread?22:37
prologicyeah it's not meant as a way to do static typing22:40
prologicor restrict what an object can have22:40
prologicit's more about memory22:40
prologicthe CPython interpreter can allocate up-front only what it needs for the class/object22:40
prologicbecause it's internal __dict__ wil never contain more than what you've defined in __slots__22:40
y0noprologic, okay :)22:54
prologicdoes that make sense?22:55
prologicit's also a bit more readble the way spaceone has done it22:55
prologicrather than just a dict being passed around22:55
y0noprologic, yep I totally agree concerning the readability23:05

Generated by irclog2html.py 2.11.0 by Marius Gedminas - find it at mg.pov.lt!