Note about getattr and '.'
steve at REMOVEME.cybersource.com.au
Wed Nov 22 05:09:43 CET 2006
On Tue, 21 Nov 2006 22:39:09 +0100, Mathias Panzenboeck wrote:
> szport at gmail.com wrote:
>> There is an interesting skewness in python:
>> class A(object): pass
>>>>> setattr(a, '$foo', 17)
>>>>> getattr(a, '$foo')
>> But I can't write
> Yes, this is known. I think IronPython uses a specialized dictionary for members, which prohibits
> malformed names. I don't know if there will be such a dictionary in any future CPython version.
> (Would be good.)
Why would it be good?
How many bugs have you found that were caused by this behaviour?
More information about the Python-list