Ishwor wrote:
On Thu, 23 Dec 2004 13:57:55 -0300, Batista, Facundo
<[EMAIL PROTECTED]> wrote:
#- True, true. Maybe you could lobby for copy as a builtin in
#- Python 3000?
That's a good idea to me. But copy() as a builtin is not clear if it's
shallow or deep.
IMHO its preferable to use shallow one as the built-in because deep is
expensive op. for CPU. ~;-)
"deepcopy" is an operation that is less well defined than shallow copy
anyway (and hence shouldn't be a default). Objects representing
constants may contain a cache (for example) as an efficiency measure,
and "deepcopy" needn't copy such objects. The only way to safely
do deepcopy is to copy down to immutables, but usually there is a
shallower and faster implementation that depends on application
semantics.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list