[Python-3000] Nix dict.copy()

Aahz aahz at pythoncraft.com
Mon Feb 11 04:44:19 CET 2008


On Mon, Feb 11, 2008, Greg Ewing wrote:
> Aahz wrote:
>> 
>> Let's suppose you have an object that represents an order.  And let's
>> suppose that this object needs to be copied to create a re-order (letting
>> the customer preserve the information from the original order).
> 
> In that case, I would give my Order class a copy() method (or
> re_order() or whatever name is appropriate) that does the right
> thing for orders in the context of that application.
> 
> There are bound to be things that you *don't* want to copy from
> the original order, e.g. the order ID, the date...

Certainly -- that's why __copy__() exists, right?
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"All problems in computer science can be solved by another level of     
indirection."  --Butler Lampson


More information about the Python-3000 mailing list