__slots__
David Isaac
aisaac0 at verizon.net
Sat Mar 25 10:31:33 EST 2006
"Aahz" <aahz at pythoncraft.com> wrote in message
news:e0195k$5j5$1 at panix3.panix.com...
> Because __slots__ breaks with inheritance.
I believe that was the point of Ziga's example,
which I acknowledged as a good one in my reply.
So there still appears to be this single reason, which
applies if your class may be subclassed.
Does this beg the question of whether __slots__
*should* break with inheritance?
One other question I did not get answered: is there any
simple example of a Pythonic use of __slots__ that does NOT
involve the creation of **many** instances.
Thanks,
Alan Isaac
More information about the Python-list
mailing list