Josh Rosenberg <shadowranger+pyt...@gmail.com> added the comment:

Would we remove the functionality of os.environ.copy()? It seems very odd for 
types to have a .copy() method that works, while not supporting copy.copy, 
especially when there is zero documentation, on the web or the docstring, to 
even hint at the difference.

I'm strongly in favor of silently doing the right thing and behaving the same 
way the .copy() method already behaves; if you want a "copy" of os.environ that 
still modifies the environment, that's just aliasing it (envalias = 
os.environ), not copying at all. If you're trying to make a shallow copy, not 
an alias, you're trying to separate it from the parent, which every other 
dict-like thing does (assuming immutable values), where os.environ is a very 
weird exception (for copy.copy, but not the .copy() method).

Can someone give an example where you'd want copy.copy to produce a "shallow 
copy" that acts like an alias, not an actual independent copy?

----------
nosy: +josh.r

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue15373>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to