Hi,

class A(object):
    test = "test"

class B(object):
    a = A()


In [36]: B.a.test
Out[36]: 'test'

In [37]: getattr(B, "a.test")
---------------------------------------------------------------------------
<type 'exceptions.AttributeError'>        Traceback (most recent call last)

/<ipython console> in <module>()

<type 'exceptions.AttributeError'>: type object 'B' has no attribute 'a.test'

???

Documentation says B.a.test and getattr(B, "a.test") should be equivalent.

http://docs.python.org/lib/built-in-funcs.html

any help?

Greg
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to