Thanks for the bug report.  I've filed this as CodePlex bug 562.  This one 
sounds like it'll be trivial to fix so we should have it for the next release.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord
Sent: Thursday, June 22, 2006 4:41 AM
To: Discussion of IronPython
Subject: [IronPython] Inconsistency in getattr exceptions

Hello all,

getattr in IronPython raises different exceptions to CPython for invalid input.

CPython

 >>> getattr(a, None)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: getattr(): attribute name must be string  >>>


IronPython

 >>> a = object()
 >>> getattr(a, None)
Traceback (most recent call last):
  File , line 0, in <stdin>##64
  File , line 0, in GetAttr##65
AttributeError: 'object' object has no attribute ''
 >>>


Note also that exceptions in IronPython involving a None often print the empty 
string, which can be unhelpful. (Which is odd since both
repr(None) and str(None) return 'None'.)

All the best,


Michael Foord
http://www.resolversystems.com
http://www.voidspace.org.uk/python/index.shtml
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to