[Python-Dev] Meta-reflections

Tim Peters tim.one@comcast.net
Thu, 21 Feb 2002 17:51:13 -0500

> Slots were definitely intended as a memory optimization, and the ways in
> which they don't act like "regular old attributes" are at best warts.

[Samuele Pedroni]
> I see, but it seems that the only way to coherently and transparently
> remove the warts implies that the __dict__ of a new-style class
> instance with slots should be tied with the instance and cannot
> be anymore a vanilla dict. Something only Guido can rule about.

He'll be happy to <wink>.  Optimizations aren't always wart-free, and then
living with warts is a price paid for benefiting from the optimization.  I'm
sure Guido would consider it "a bug" if slots are ignored by the pickling
mechanism, but wouldn't for an instant consider it "a bug" that the set of
slots in effect when a class is created can't be dynamically expanded later
(this latter is more a sensible restriction than a wart, IMO -- and likely
in Guido's too).