[Python-3000] Nix dict.copy()

"Martin v. Löwis" martin at v.loewis.de
Sun Feb 10 22:01:42 CET 2008


Raymond Hettinger wrote:
> [Phillip Eby]
>> I'm not fond of this idea. dict.copy() is polymorphic -- but dict(d) is...
> 
> Can't say dict.copy() is really polymorphic if only one other class defines the method.

Why do you say it's only one? I found atleast UserDict.copy, 
os._Environ.copy, WeakValueDictionary.copy, WeakKeyDictionary.copy,
and test.test_userdict.SeqDict. Notice that UserDict.copy is also
polymorphic in the sense that it may return instances of subclasses,
by using copy.copy.

Regards,
Martin



More information about the Python-3000 mailing list