[Python-Dev] implementation of copy standard lib

Michael Hudson mwh at python.net
Wed Aug 17 05:10:12 EDT 2005


Simon Brunning <simon.brunning at gmail.com> writes:

> I think that copy is very rarely used. I don't think I've ever imported it.
>
> Or is it just me?

Not really.  I've used it once that I can recall, to copy a kind of
generic "default value", something like:

def value(self, v, default):
    if hasattr(source, v): return getattr(source, v)
    else: return copy.copy(default)

(except not quite, there would probably be better ways to write
exactly that).

Cheers,
mwh

-- 
  <washort> glyph: you're evil, too
  <glyph> washort: I try
  <washort> not the good kind of evil
  <washort> the other kind                      -- from Twisted.Quotes



More information about the Python-list mailing list