On Sun, Feb 10, 2008, Christian Heimes wrote: > Larry Hastings wrote: >> >> +1 for exactly the reasons cited. I think copy() and deepcopy() should >> both be "essential" built-in functions. > > I'm -0 on copy and -1 on deepcopy. > > If you need a copy or a deepcopy of an object (except dicts, lists and > sets) you are most certainly using the wrong approach. Back when I was > learning Python over 5 years ago I was using copy and deepcopy often. > Nowadays I don't need the copy module anymore because I've learned how > to design software without the need for copies.
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). How do you suggest that the re-order be created without copy(), and especially deepcopy()? What if an attribute of orders can be a list or dict? -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "All problems in computer science can be solved by another level of indirection." --Butler Lampson _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com