[issue15373] copy.copy() does not properly copy os.environment
Raymond Hettinger
report at bugs.python.org
Fri Jan 27 20:02:28 EST 2017
Raymond Hettinger added the comment:
[Antoine]
> I agree with David that copy(os.environ) is rather ambiguous.
> I think the preferred idiom should be to call dict(os.environ).
> As for __copy__, I don't know what it should do: perhaps
> simply raise an error when copying is attempted?
FWIW, I concur with Antoine on every point. Also, raising an error when copying seems reasonable ("refuse the temptation to guess" at what the user intended).
----------
nosy: +rhettinger
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15373>
_______________________________________
More information about the Python-bugs-list
mailing list