[Python-Dev] decimal.Context.copy() shallow or deep?

Batista, Facundo FBatista at uniFON.com.ar
Mon Aug 9 15:48:50 CEST 2004


[Raymond Hettinger]

#- > > Do you guys think it should be left alone (shallow) or 
#- changed (made
#- > > deep)?
#- > 
#- > A user-visible copy certainly should not share mutable 
#- state with the
#- > original. 
#- 
#- I was afraid of that.  What a PITA.

My opinion is that the important step here is to fix the behaviour before
alpha-3 or beta (whatever cames first).

So, it's nice your idea to rename context.copy() to context._shallow_copy(),
make context.copy() deep, and then, in all the tests that fail, change copy
for the shallow one.

Later, we'll have time to maybe fix that and don't depend of a shallow copy
(work around that WorkRep would be nice also).

.	Facundo


More information about the Python-Dev mailing list