[IronPython] __slots__

Michael Foord fuzzyman at voidspace.org.uk
Mon Mar 9 06:19:02 PDT 2009


Hello guys,

It looks like __slots__ and inheritance are a bit odd in IronPython 
(2.0.1). slots.py:

class A(object):
    __slots__ = []
   
class B(A):
    __slots__ = []
   
i = B()
i.test = 3


Running with IronPython and CPython:

C:\compile\resolver-michael>"C:\Program Files (x86)\IronPython 
2.0.1\ipy.exe" -D
 -X:TabCompletion -X:ColorfulConsole slots.py

C:\compile\resolver-michael>python slots.py
Traceback (most recent call last):
  File "slots.py", line 8, in ?
    i.test = 3
AttributeError: 'B' object has no attribute 'test'

C:\compile\resolver-michael>

Michael

-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog




More information about the Users mailing list