Copy operator (was list.remove for Noivces)

Andreas Kostyrka andreas at mtg.co.at
Wed Nov 28 14:36:28 EST 2001


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

Am Mittwoch, 28. November 2001 04:54 schrieb arthur.siegel at rsmi.com:
> Disagree strongly.  What is being accomplished is raising the visiblity
> of the issue within the language itself. I would argue that the status quo
> conspires to underplay the significance of the issues involved - no harm
> done to those who already understand them.
Well, I never had a problem with understanding the Python semantics. There 
are other languages that do have similiar semantics. (Actually most OO 
languages use only object references, not values)

> One imports copy, like one imports cgi or tokenize. To a beginner, imports
> from outside  modules  is strictly special purpose stuff. In my case it was
> a long time before much beyond math ,os and sys perhaps, were anything more
> than absolute exotica.
Well, then I have something quite funny to you. I've been doing quite much 
Python development lately (basically since 1995). I've never written "import 
copy" myself. I've just checked one of my bigger python projects (maintained 
since Python 1.3 times ;) ):
.py size:   22454 lines  555633 bytes
import copy: 0 times
[:] shallow copy: 7 times

Zope 2.3.2:
.py size:  126029 4419635
import copy: 1 times (used once as copy.copy(...))
[:] shallow copy: 68 times

Python 2.2b1 Standard library:
.py size: 183031 6110941
import copy: 9 times
shallow [:] copy: 75 times
What does this tell us?
IMHO, while copy is quite important functionality, most heavy Python 
developers don't exactly overuse it. :)

> As I said, whether I am correct that it would be a significant enhancement
> making Python better designed to get beginners aware  of and over some
> important humps, is not where my larger doubts are.  Of course realizing a)
> I could be missing something  (but I would need convincing) and b) even if
See above. Just a bit greping. Of 732 .py files installed in my Python lib 
directory, only 9 files (1.23%) import copy. Zope is even a better example 
(0.21% filewise, linewise it's just 1/1260.29 %)
> I am not., that it would be a long and - if the past be a guide - probably
> fruitless effort to try to convince folks there is significant merit in my
> position.
Well, I'm not convinced. But then I prefer the luxus cabin "Python" instead 
of getting my hands dirty under the hood with the "C" engine ;) (And neither 
my first, middle nor last name is Guido :) )

> My doubts are more as to the other implications that are more technical. 
> The shallow/deep copy issue I understand is there and real - but I don't
> really understand the issue itself.  I will do some homework.
Well, it's the difference between copy only one level or down to the last 
level recursivly.

Andreas
- -- 
Andreas Kostyrka; Raiffeisenstr. 16/9; 2320 Zwölfaxing
Tel: +43/676/4091256; Fax: +43/1/7065299
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8BTzEHJdudm4KnO0RAuDbAJ98bxXPjE9yk087K1ta5gb2NoFG+wCfQH3V
UviT/4gE3yEtEQNgY5t2ymQ=
=0VCH
-----END PGP SIGNATURE-----




More information about the Python-list mailing list