[Patches] [ python-Patches-1103689 ] get rid of unbound methods (mostly)

SourceForge.net noreply at sourceforge.net
Fri Jan 21 17:35:45 CET 2005


Patches item #1103689, was opened at 2005-01-17 01:10
Message generated for change (Comment added) made by gvanrossum
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1103689&group_id=5470

Category: Core (C code)
Group: Python 2.5
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: Nobody/Anonymous (nobody)
Summary: get rid of unbound methods (mostly)

Initial Comment:
Here's a patch that gets rid of unbound methods, as
discussed on python-dev. A function's __get__ method
now returns the function unchanged when called without
an instance, instead of returning an unbound method object.

I couldn't remove support for unbound methods
completely, since they were used by the built-in
exceptions. (We can get rid of that use once we convert
to new-style exceptions.)

For backward compatibility, functions now have
read-only im_self and im_func attributes; im_self is
always None, im_func is always the function itself.
(These should issue warnings, but I haven't added that
yet.)

The test suite passes. (I have only tried "make test"
on a Linux box.)

This is still subject to further python-dev discussion.


----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2005-01-21 11:35

Message:
Logged In: YES 
user_id=6380

After many people on python-dev found code that would break
due to dependence on im_class, I'm retracting this patch.
I'd like to revisit this for Python 3000 since I really
think that it is how things *ought* to be.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1103689&group_id=5470


More information about the Patches mailing list