Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76839 > unrolled thread

Re: the output in reference of descriptor.

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2014-08-22 22:10 -0600
Last post2014-08-22 22:10 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: the output in reference of descriptor. Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-22 22:10 -0600

#76839 — Re: the output in reference of descriptor.

FromIan Kelly <ian.g.kelly@gmail.com>
Date2014-08-22 22:10 -0600
SubjectRe: the output in reference of descriptor.
Message-ID<mailman.13324.1408767061.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

On Thu, Aug 21, 2014 at 7:25 PM, luofeiyu <elearn2014@gmail.com> wrote:
> >>> c2.d.a
> __get__() is called <__main__.C2 object at 0x000000000297BE10> <class
'__main__.
> C2'>
> __getattribute__() is called
> 'abc'
>
> Why the result of c2.d.a  is not :
>
> __get__() is called <__main__.C2 object at 0x000000000297BE10> <class
'__main__.
> C2'>
> __getattribute__() is called
> 'abc'

As far as I can tell you pasted the same output twice, so I don't
understand what it is that you're asking.

> Why the` return self` in the __get__ method in class C  does not work?

It does work. When you type "c2.d" above, the result was the C instance,
i.e. self.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web