Don't use __slots__ (was Re: performance of dictionary lookup vs. object attributes)

David Isaac aisaac0 at verizon.net
Sun Aug 27 23:49:35 EDT 2006


"Jacob Hallen" <jacob at cd.chalmers.se> wrote in message
news:ectbls$ofa$1 at gide.ita.chalmers.se...
> Unfortunately there is a side effect to slots. They change the behaviour
of
> the objects that have slots in a way that can be abused by control freaks
> and static typing weenies. This is bad, because the contol freaks should
> be abusing the metaclasses and the static typing weenies should be abusing
> decorators, since in Python,there should be only one obvious way of doing
something.

Can you please elaborate?
(How to abuse metaclasses and decorators to achieve these effects?
And why is it abuse?)

Thank you,
Alan Isaac





More information about the Python-list mailing list