Elegant copy-by-value
Andrew Dalke
adalke at mindspring.com
Sun Jan 12 19:29:44 EST 2003
Mike Meyer wrote:
> If it still bothers you, how about a PEP proposing that object have
> copy and deepcopy methods that DTRT? That way, all new-style classes
> would have a copy and deepcopy methods, so you could invoke them
> without having to import a module.
Actually, I think Python could get what he wants if copy.copy and
copy.deepcopy were added to the builtins as 'copy' and 'deepcopy'.
It seems he mostly didn't like the need for an extra import, based
on the OP's statement
Martin Christensen:
] It seems strange that one should have to import a module to so
] something as simple as a copy-by-value.
Andrew
dalke at dalkescientific.com
More information about the Python-list
mailing list