Thanks for the bug report!

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Patrick O'Brien
Sent: Monday, November 20, 2006 4:36 PM
To: users@lists.ironpython.com
Subject: [IronPython] Class with slots and getattr not compatible

Ticket: 
http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=5801


IronPython:

>>> class Foo(object):
...     __slots__ = ['bar']
...     def __getattr__(self, name):
...         return name.upper()
...
>>> foo = Foo()
>>> foo.bar
Traceback (most recent call last):
  File , line 0, in <stdin>##2163
  File , line 0, in get_bar##2164
AttributeError: '<class '__main__.Foo'>' object has no attribute 'bar'
>>> foo.baz
'BAZ'
>>>


CPython:

PyCrust 0.9.5 - The Flakiest Python Shell
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo(object):
...     __slots__ = ['bar']
...     def __getattr__(self, name):
...         return name.upper()
...
>>> foo = Foo()
>>> foo.bar
'BAR'
>>> foo.baz
'BAZ'
>>>


--
Patrick K. O'Brien
Orbtech       http://www.orbtech.com
Schevo        http://www.schevo.org
Louie         http://www.pylouie.org
_______________________________________________
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to