[Python-Dev] Make it an error to use __slots__ with classic classes

Terence Way terry at wayforward.net
Sat Aug 9 13:42:03 EDT 2003


On Saturday, August 9, 2003, at 03:10  AM, Raymond Hettinger wrote:

>
> P.S.  The answer to the quick look question above is that
> __slots__ has no effect in Py2.2 but does in Py2.3
> because one is an old-style class written in pure python
> and the other is a new-style class derived from the
> MersenneTwister type.

That, to me, indicates that an exception is the wrong way to do
this...  it would be too easy to create non-backward compatible
code, especially as people start moving their classes to
new-style.

A brief test shows that PyChecker checks for this, however:
Warnings...

testslot.py:2: Using __slots__ in classic class foo has no effect, 
consider deriving from object




More information about the Python-Dev mailing list