__slots__ query

Michael Hudson mwh at python.net
Tue Apr 2 11:53:08 EST 2002


Robin Becker <robin at jessikat.fsnet.co.uk> writes:

> I notice that in 2.2 it's possible to do strange things to slots via
> instances.

There were lengthy threads on python-dev about this not so long ago (I
recommend the thread on "Meta-reflections" from February this year).

I think the best summary of the answer would be "yes, you can" with
overtones that you probably shouldn't be using __slots__ without a
thorough understanding of the consequences (but, as I seem to be
saying a lot of late, I didn't really concentrate on the thread).

Cheers,
M.



More information about the Python-list mailing list