[Python-3000] Nix dict.copy()

Daniel Stutzbach daniel at stutzbachenterprises.com
Wed Feb 13 00:11:09 CET 2008


On Feb 12, 2008 4:52 PM, Guido van Rossum <guido at python.org> wrote:

> > What useful information do we get by knowing that a type has a .copy()
> > method?
>
> It rules out all classes that don't have one. That's nearly all types.
>

Okay, but turn it around for a minute.  Which types should have a .copy()
method and why?

If I'm making a new copyable type, is there a rule of thumb that helps me
decide on .copy(), .__copy__(), or both?

Rules of "dict and set have a .copy() method" or "mapping types have a
.copy() method" seem... arbitrary.

-- 
Daniel Stutzbach, Ph.D.             President, Stutzbach Enterprises LLC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000/attachments/20080212/b0f2e170/attachment.htm 


More information about the Python-3000 mailing list