[BangPypers] Object Oriented Programming in python
noufal at nibrahim.net.in
Mon Oct 21 08:02:17 CEST 2013
Saager Mhatre <saager.mhatre at gmail.com> writes:
> Ah, that explains so much. I've always been confused about slots and
> the documentation almost always added to it. Does this mean that once
> you drop to slots, you also lose the descriptor- based dispatch magic?
> That would make this a pretty desperate hack for some last resort
> memory conservation!
I don't know if you lose descriptors. I've never really used __slots__
myself since I've not run into memory tight situations like the ones for
which __slots__ was made for. I have run Python on a usb webcam but I
don't do fancy OO there. I just use raw functions and things like the
array and struct modules to make sure that I have some handle on
how much memory I'm using.
I don't think it's particularly neat which is probably why, as you
mentioned in your original email, it's obscure. It's the final frontier
beyond which space lies (sorry).
More information about the BangPypers