[Python-Dev] Getting rid of unbound methods: patch available
Delaney, Timothy C (Timothy)
tdelaney at avaya.com
Tue Jan 18 23:54:59 CET 2005
Guido van Rossum wrote:
> [Timothy Delaney]
>> If im_func were set to the class where the function was defined, I
>> could definitely avoid the second part of the trawling (not sure
>> about the first yet, since I need to get at the function object).
>
> Instead of waiting for unbound methods to change their functionality,
> just create a metaclass that sticks the attribute you want on the
> function objects.
Yep - that's one approach I've considered. I've also thought about
modifying the code objects, which would mean I could grab the base class
directly.
It's definitely not the most compelling use case in the world ;)
Tim Delaney
More information about the Python-Dev
mailing list