[Python-Dev] Re: [Python-checkins] python/dist/src/Lib pprint.py, 1.24, 1.25

Gerrit Holl gerrit@nl.linux.org
Sun, 8 Jun 2003 18:09:08 +0200


Hi,

Alex Martelli wrote:
> >     if issubclass(typ, dict) and type(typ.__repr__) is type(dict.__repr__):
> >         # do stuff
> 
> Aren't the calls to type() here wrong?  It seems to me that what you want
> to check is just whether typ.__repr__ is dict.__repr__, not if the types of 
> the two bound methods are the same.

I was confused: I thought methods were dynamically created, but that is
only true for bound methods, not for unbound methods. typ.__repr__ is
dict.__repr__ is correct indeed.

yours,
Gerrit.

-- 
252. If he kill a man's slave, he shall pay one-third of a mina.
        -- 1780 BC, Hammurabi, Code of Law
--
Asperger Syndroom - een persoonlijke benadering:
	http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
	http://www.sp.nl/