[Python-ideas] Have list/deque grow a copy() method

Fred L. Drake, Jr. fdrake at acm.org
Tue May 15 18:06:49 CEST 2007


On Tuesday 15 May 2007, Steven Bethard wrote:
 > For builtin container types (and many other container types as well):
 >     type(obj)(obj)
 > is another polymorphic way to create copies.

If you're willing to rely on the constructor signature, sure.  For many 
applications, the convention that the constructor can be used as a copier 
doesn't hold.


  -Fred

-- 
Fred L. Drake, Jr.   <fdrake at acm.org>



More information about the Python-ideas mailing list