A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/1999-September/001001.html below:

[Python-Dev] Methods and friends

[Python-Dev] Methods and friends [Python-Dev] Methods and friendsM.-A. Lemburg mal@lemburg.com
Fri, 17 Sep 1999 17:53:38 +0200
Guido van Rossum wrote:
> 
> > It seems that for every method call the following happens:
> > 1. the method is looked up in the instance dict; this fails
> > 2. the method is looked up in the class dict; this succeeds
> >    and returns a function
> > 3. the class then turns the function into a new unbound method
> > 4. the instance sees the unbound method and creates a new
> >    bound method (deleting the unbound method) and returns it
> 
> Are you sure?  As far as I know, steps 3 and 4 are combined when you
> do getattr on an instance: instance_getattr() calls
> instance_getattr1() which calls class_lookup().  The latter doesn't
> create an unbound method.  instance_getattr1() then turns it into a
> bound method.
 
Oops. Correct. I should have looked a little closer. So it
already works in the first way I mentioned as improvement... your
time machine again ;-)

-- 
Marc-Andre Lemburg
______________________________________________________________________
Y2000:                                                   105 days left
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4