[Ironpython-users] How to get the full path (in dotted notation) to an attribute?

sepatan at sibmail.com sepatan at sibmail.com
Thu Sep 6 04:01:27 CEST 2012


So what's the conclusion:
 __main__ c ff
 A must:
a.b.c ff
>
> print cls.__module__, cls.__name__, t
>
> - Jeff
>
> On Tue, Sep 4, 2012 at 10:21 PM,  <sepatan at sibmail.com> wrote:
>> Hello.
>> How to get the full path (in dotted notation) to an attribute:
>>
>> class meta (type):
>>     def __ getattr__ (cls, t):
>>         print cls.__name__, t
>>
>> class a (object):
>>     class b (object):
>>         class c (object):
>>             __metaclass__ = meta
>>
>> a.b.c
>> a.b.c.ff
>>
>> The result:
>> c ff
>>
>> And how to get:
>> a.b.c ff



More information about the Ironpython-users mailing list