[Python-3000] Nix dict.copy()

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Feb 12 23:39:13 CET 2008


Guido van Rossum wrote:
> I used Google Code Search to find examples of copy.copy().
> Many were hard to understand because there was no clue about the
> argument passed it, and the copy() call doesn't help me infer its type
> either. Contrast this with example code using iter() -- it tells me
> that the argument is an iterable. That rules out lots of
> possibilities, like numbers.

Hmmm. Personally I'm not sure that such ad-hoc piecemeal
type inference is all that useful. Just knowing that
something is an iterable still doesn't tell me anything
about the type of the items it contains, which is
likely to be of much more interest to me.

Similarly, just knowing that something has a copy()
method doesn't narrow things down all that much. It
might be a dict, or a set, or something else the user
has come up with, which could be just about anything.

--
Greg



More information about the Python-3000 mailing list