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/2003-February/033432.html below:

[Python-Dev] CALL_ATTR, A Method Proposal

[Python-Dev] CALL_ATTR, A Method ProposalGuido van Rossum guido@python.org
Fri, 14 Feb 2003 13:21:08 -0500
> I thought one thing Glyph was trying to address was the single-use nature of
> the instancemethod object.  Once it's been created, can't you just cache it
> in the instance for later reuse?  When it's needed, you borrow it from the
> instance, use it, then put it back (assuming the slot in the instance is
> still empty, otherwise you DECREF it).  I think that would make it thread
> safe.

The caching would have to be done by the instance object's getattr()
implementation; there are all sorts of situations where the cache
would have to be invalidated and only the instance (really, its class)
knows about that.

And note that the compiler doesn't know the type of <obj> in
<obj>.<name>(<args>).  <obj> might be a module or an extension object.

--Guido van Rossum (home page: http://www.python.org/~guido/)



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