Note about getattr and '.'

szport at gmail.com szport at gmail.com
Tue Nov 21 16:21:52 EST 2006


There is an interesting skewness in python:

class A(object): pass

>>> a=A()
>>> setattr(a, '$foo', 17)
>>> getattr(a, '$foo')
17

But I can't write 
>>> a.'$foo'




More information about the Python-list mailing list