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/2008-September/082267.html below:

[Python-Dev] Can/should built-in functions get __get__?

[Python-Dev] Can/should built-in functions get __get__? [Python-Dev] Can/should built-in functions get __get__?Fredrik Lundh fredrik at pythonware.com
Fri Sep 5 12:06:14 CEST 2008
Terry Reedy wrote:

> In particular, built-in functions, in spite of of being labeled 
> 'builtin_function_or_method', are not usable as methods because they 
> lack the __get__ method needed to bind function to instance.

They're not usable as Python-level instance methods, but they're 
definitely usable as methods, since they're used to implement methods 
for built-in types.

I'm probably missing something, but I don't think there's a convenient 
method to get the internal function from a built-in type.  However, you 
can find traces of them here and there:

 >>> "".upper.hello
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
AttributeError: 'builtin_function_or_method' object has no attribute 'hello'
 >>> "".upper.__call__
<method-wrapper '__call__' of builtin_function_or_method object at 
0x00C06260>

etc.

</F>

More information about the Python-Dev mailing list

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