[Edu-sig] Fw: Python sequences by reference - how to make

Kirby Urner urnerk@qwest.net
Sat, 21 Sep 2002 09:00:47 -0700


>
>I think if the decision is to go with 'from copy import copy, deepcopy'
                                ^^^^^^^
                                stay with

>then the workaround is to address copying for centrally in the tutorials.
>                                           ^^^^^^^^^^^^^
                                            more centrally

Since understanding the variablename -> object relationship is so
central to Python, one could argue that hiding 'copy' in a library
is a way to *ensure* newbies will keep stubbing their toe on this
missing capability, until the relationship is "gotten".

Because the distinction between copy and deepcopy requires a fairly
clear appreciation of this same relationship, just including them
in the builtins without a lot of explanation would be unlikely to
address core confusions.

I understand your side of it though:  having them be there would
encourage earlier, deeper investigation of the whole topic, and
remind the user that a=b does *not* necessarily get that job done.

Guido's school of thought says 'these are power tools that need
to be on a higher shelf, so the casual tinkerer won't abuse them
-- if you're not ready to tackle importing, you're not ready to
start copying, let alone deepcopying.'

Kirby