Try the following code snippet in Python 2.7 and Python 3.1
class AClass: __slots__ = ['a', 'b', 'c'] print(type(AClass)) print(issubclass(AClass,object)) print(isinstance(AClass,type))
In Python 2.7 you get:
<type 'classobj'> False False
And Python 3.1 you get.
<class type> True True
And that explains everything. This is an old style class in Python 2, unless you subclass it from object . Only in Python3 will it be processed by default as a new style class.
Senthil kumaran
source share