[IronPython] __slots__

Michael Foord fuzzyman at voidspace.org.uk
Mon Mar 9 14:28:38 CET 2009


Curt Hagenlocher wrote:
> I believe this is already fixed in the current (ie 2.6ish) source.

Any chance for 2.0.2?

Michael

>
> On Mon, Mar 9, 2009 at 5:19 AM, Michael Foord 
> <fuzzyman at voidspace.org.uk <mailto:fuzzyman at voidspace.org.uk>> wrote:
>
>     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
>
>
>     _______________________________________________
>     Users mailing list
>     Users at lists.ironpython.com <mailto:Users at lists.ironpython.com>
>     http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>   


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





More information about the Ironpython-users mailing list