Elegant copy-by-value

Martin Christensen knightsofspamalot-factotum at gvdnet.dk
Sat Jan 11 19:33:35 EST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

Python usually uses copy-by-reference. This is all good and well, but
sometimes we want copy-by-value. For a long time now I've been using
copy() or deepcopy(), depending on the circumstances, from the copy
module. Is there no more simple and elegant way of doing this? It
seems strange that one should have to import a module to so something
as simple as a copy-by-value. I should, of course, have researched
this a long, long time ago, but deadlines have a way of defering such
luxuries. :-)

Martin

- -- 
Homepage:       http://www.cs.auc.dk/~factotum/
GPG public key: http://www.cs.auc.dk/~factotum/gpgkey.txt
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using Mailcrypt+GnuPG <http://www.gnupg.org>

iEYEARECAAYFAj4gt98ACgkQYu1fMmOQldWslwCfRTCAOLNxAh4stkyfpsG03MNn
y+0AniqSkJp6NpqiaYSyxRRBvghxiC4J
=KMQM
-----END PGP SIGNATURE-----




More information about the Python-list mailing list