[Python-Dev] Let's get rid of unbound methods

Bob Ippolito bob at redivi.com
Wed Jan 5 00:26:27 CET 2005


On Jan 4, 2005, at 6:01 PM, Jack Jansen wrote:

>
> On 4-jan-05, at 19:28, Guido van Rossum wrote:
>>  The
>> extra type checking on the first argument that unbound methods are
>> supposed to provide is not useful in practice (I can't remember that
>> it ever caught a bug in my code)
>
> It caught bugs for me a couple of times. If I remember correctly I was 
> calling methods of something that was supposed to be a mixin class but 
> I forgot to actually list the mixin as a base. But I don't think 
> that's a serious enough issue alone to keep the unbound method type.
>
> But I'm more worried about losing the other information in an unbound 
> method, specifically im_class. I would guess that info is useful to 
> class browsers and such, or are there other ways to get at that?

For a class browser, presumably, you would start at the class and then 
find the methods.  Starting from some class and walking the mro, you 
can inspect the dicts along the way and you'll find everything and know 
where it came from.

-bob



More information about the Python-Dev mailing list