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

Antoon Pardon apardon at forel.vub.ac.be
Tue Aug 29 03:07:53 EDT 2006


On 2006-08-27, Jacob Hallen <jacob at cd.chalmers.se> wrote:
> In article <1156625365.346825.18630 at 74g2000cwt.googlegroups.com>,
> Patrick Maupin <pmaupin at gmail.com> wrote:
>
> 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.

Your emphasis is wrong.

In Python there should be one obvious way of doing something. Preferably
this is the only obvious way. 

-- 
Antoon Pardon



More information about the Python-list mailing list