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/2013-July/127176.html below:

[Python-Dev] lament for the demise of unbound methods

[Python-Dev] lament for the demise of unbound methods [Python-Dev] lament for the demise of unbound methodsChris Withers chris at simplistix.co.uk
Thu Jul 4 14:13:57 CEST 2013
On 04/07/2013 12:59, Christian Heimes wrote:
> Am 04.07.2013 13:21, schrieb Chris Withers:
>> There doesn't appear to be any way in Python 3 to do this, which is a
>> little surprising and frustrating...
>>
>> What am I missing here?
>
> I removed unbound methods almost six years ago:
>
> http://hg.python.org/cpython/rev/48af6375207e

Not disputing when it happened, more the why...

...the recommended change doesn't work, for obvious reasons:

 >>> MyClass.method.__self__.__class__
Traceback (most recent call last):
   File "<console>", line 1, in <module>
AttributeError: 'function' object has no attribute '__self__'

The loss of the ability to figure out the class from an unbound method 
seems quite an annoying step back from an introspection point of view.

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk
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