List copying idiom was Re: [Python-Dev] implementation of copy standard lib

Tom Anderson twic at urchin.earth.li
Wed Aug 17 14:51:33 CEST 2005


On Wed, 17 Aug 2005, Steve Holden wrote:

> Tom Anderson wrote:
>
>> On Tue, 16 Aug 2005, Ron Adam wrote:
>> 
>>> Simon Brunning wrote:
>>> 
>>>> On 8/14/05, Martijn Brouwer <e.a.m.brouwer at alumnus.utwente.nl> wrote:
>>>> 
>>>>> I can imagine that *a lot* of libs/scripts use the copy library,
>>>> 
>>>> I think that copy is very rarely used. I don't think I've ever 
>>>> imported it.
>>> 
>>> I too have wondered why copy isn't a builtin,
>> 
>> Same here. It seems like a sort of obvious thing to have, and could 
>> probably implemented much more simply and quickly in the interpreter. You'd 
>> probably want a __copy__ hook for classes which want special handling, and 
>> just do a normal deep copy for everything else.
>
> Well yes, but given that module copy now exists (and will therefore have 
> to continue ti exist until Py3) that would introduce some redundancy.

True. This is more of a vague Py3k wish than a serious suggestion.

tom

-- 
10 PARTY : GOTO 10



More information about the Python-list mailing list