[Python-Dev] lament for the demise of unbound methods
Guido van Rossum
guido at python.org
Thu Jul 4 18:25:31 CEST 2013
Chris, what do you want to do with the knowledge you are seeking?
--Guido van Rossum (sent from Android phone)
On Jul 4, 2013 4:28 AM, "Chris Withers" <chris at simplistix.co.uk> wrote:
> Hi All,
>
> In Python 2, I can figure out whether I have a method or a function, and,
> more importantly, for an unbound method, I can figure out what class the
> method belongs to:
>
> >>> class MyClass(object):
> ... def method(self): pass
> ...
> >>> MyClass.method
> <unbound method MyClass.method>
> >>> MyClass.method.im_class
> <class '__main__.MyClass'>
>
> 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?
>
> Chris
>
> --
> Simplistix - Content Management, Batch Processing & Python Consulting
> - http://www.simplistix.co.uk
> ______________________________**_________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/**mailman/listinfo/python-dev<http://mail.python.org/mailman/listinfo/python-dev>
> Unsubscribe: http://mail.python.org/**mailman/options/python-dev/**
> guido%40python.org<http://mail.python.org/mailman/options/python-dev/guido%40python.org>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130704/710c4258/attachment-0001.html>
More information about the Python-Dev
mailing list