Elegant copy-by-value
Peter Hansen
peter at engcorp.com
Mon Jan 13 14:56:46 EST 2003
More information about the Python-list mailing list
Mon Jan 13 14:56:46 EST 2003
- Previous message (by thread): Elegant copy-by-value
- Next message (by thread): OT: Random proofs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Terry Hancock wrote: > > Peter Hansen wrote: > > Andrew Bennetts wrote: > >> In which case, perhaps all they want is the following code: > >> from copy import copy, deepcopy > >> __builtins__.copy = copy > >> __builtins__.deepcopy = deepcopy > > Added to a file called sitecustomize.py somewhere in the set > > of directories in sys.path... > > Which means it'll break as soon as someone else tries to use his code. > Isn't that a very forgettable place? It reminds me of another thread in > which someone wanted to be able to reach standard library modules even if > they are overloaded by a local module. Is this really a wise thing to do? > Or should such code perhaps go in a __init__.py for whatever package is > being developed? > > Just trying to plan ahead ;-) Good point. That goes back to the original advice of "learn to like it as it is" instead of jumping through hoops to avoid a little extra typing. I was just trying to make it as convenient as he seemed to want, by avoiding those "inconvenient" imports and assignments above. Thanks for pointing out again how futile this is... -Peter
- Previous message (by thread): Elegant copy-by-value
- Next message (by thread): OT: Random proofs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list