Copy operator (was list.remove for Noivces)

Andreas Kostyrka andreas at mtg.co.at
Mon Dec 3 06:02:07 EST 2001


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

Am Samstag, 1. Dezember 2001 02:57 schrieb Arthur Siegel:
> How far over  my head am I getting by arguing with you here.  I see *no*
> similarity between the kind of functionality sys brings in to that of
Well, the comparision is quite valid, as sys provides rather trivial things 
like script arguments, stdin, stdout, stderr, (well we Unixheads consider 
that stuff important), and exit() which one needs quite often.
> copy.  Copy just operates - and only on objects  that are.  Sys provides
> functionality and information, that among other things, is platform
> and version specific. I feel better when someone clearly needs to
> stretch to this extent to defeat a point I am trying to make.
> I take it as a no, I am not totally off-base.
In a theoretic way perhaps. On a pragmatic level you are totally off-base ;)

> And perhaps also in the process you have gotten far out of touch with the
> process of learning one's *first* language.
Might be. Python is pragmatic language. I'm not yet in the teaching business, 
so I haven't considered if Python is a good first language. 

> >Think again: You are talking about the copy module that in the current
> > code base is rather seldom used. Why should a function that is that
> > seldom used be
> >moved to __builtin__?
> >
> >
> > What is the downside of copy and deepcopy as built_ins.  Unnecessary
> > performance hits in the majority of mods which don't need it, I expect.
> >
> >>Nope. Namespace pollution. Actually, there is already more than enough
> > baggage
> >in __builtin__ that nowadays wouldn't be needed there.
> >>And the need to be backwards compatible for the next decades.
>
> Namespace pollution?  I assume you mean you might want to use "copy",
> and its been taken. Not sure that in itself is a big thing.  I do assume
> that back compatible issues - there could be a lot of custom defined
> copy def and classes out there - could be a *big* issue.
Nope. I mean namespace polution. Your above problem is not relevant in Python 
as one can rename all builtin names.

Python 2.2b1 (#4, Nov 13 2001, 19:26:16)
[GCC 2.95.3 20010315 (SuSE)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> None=3
>>> print None
3

Actually, if you like it your way, you can add this to lines to your site.py:
import copy,__builtin__
__builtin__.copy=copy.copy

Afterwards your python will have a copy function without needing import copy.

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

iD8DBQE8C1uyHJdudm4KnO0RAr9bAJ9qTiVwopfWVwpiwuaVfk2yyqIerACgmdz9
eGtxz5jluYAC6eg273gVRdE=
=kZpZ
-----END PGP SIGNATURE-----




More information about the Python-list mailing list