List replication operator

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri May 25 11:47:13 EDT 2018


On Fri, 25 May 2018 18:06:00 +1000, Chris Angelico wrote:

> Downside: while it's all very well to say that this is equivalent to
> copy.deepcopy(), that would imply replicating copy.deepcopy's semantics
> in the core list type (unless it's actually literally defined as
> importing a module and calling a function), and deepcopy is a
> complicated function.

Betcha it's not as complicated as the import statement, and the bulk of 
that is now implemented as pure Python :-)

But you make a good point: deep copying is not a trivial operation.


-- 
Steve




More information about the Python-list mailing list