[IronPython] __slots__

Curt Hagenlocher curt at hagenlocher.org
Mon Mar 9 14:27:22 CET 2009


I believe this is already fixed in the current (ie 2.6ish) source.

On Mon, Mar 9, 2009 at 5:19 AM, Michael Foord <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
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090309/4c5bc47e/attachment.html>


More information about the Ironpython-users mailing list