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
