Re: the output in reference of descriptor.

2014-08-24 Thread Steven D'Aprano
luofeiyu wrote: > let me paste it again to make my question more clear: > > >>>c2.d > __get__() is called <__main__.C2 object at 0x0297BE10> > > <__main__.C object at 0x0297BBA8> You have an instance c2. You do an attribute lookup on d, which is a descriptor, so d

Re: the output in reference of descriptor.

2014-08-23 Thread luofeiyu
let me paste it again to make my question more clear: >>>c2.d __get__() is called <__main__.C2 object at 0x0297BE10> <__main__.C object at 0x0297BBA8> >>> c2.d.a __get__() is called <__main__.C2 object at 0x0297BE10> __getattribute__() is cal

Re: the output in reference of descriptor.

2014-08-22 Thread CHIN Dihedral
On Friday, August 22, 2014 9:25:02 AM UTC+8, luofeiyu wrote: > class C(object): > Well, in python class is treated as onte of the first class built in operations. class "new_class_ame" ( parentclasses) Please check this syntax first in Python. > a = 'abc' > > def __getattri

Re: the output in reference of descriptor.

2014-08-22 Thread Ian Kelly
On Thu, Aug 21, 2014 at 7:25 PM, luofeiyu wrote: > >>> c2.d.a > __get__() is called <__main__.C2 object at 0x0297BE10> C2'> > __getattribute__() is called > 'abc' > > Why the result of c2.d.a is not : > > __get__() is called <__main__.C2 object at 0x0297BE10> C2'> > __getattribu