Message399654
I think an asdict() method is not necessary. Instanciating a dict from os.environ is enough:
>>> import os
>>> os.environ
environ({'SHELL': '/bin/bash', ...})
>>> dict(os.environ)
{'SHELL': '/bin/bash', ...})
With 'dict()', it's obvious there is no side effect.
I think os._Environ should not be pickable too because there is an ambiguity too when it will be unpicked: should we set the unpickled data to a basic dict (or another _Environ instance) or to the environment variables?
It seems there are more maintainers in favour of the removal. Removing the copy is a breaking change so it should be done on several releases.
Are you interested by a PR which adds DeprecationWarning when copy.copy(os.environ) or os.environ.copy() are called? It seems to be the first step to implement. |
|
Date |
User |
Action |
Args |
2021-08-16 11:51:11 | sblondon | set | recipients:
+ sblondon, rhettinger, gregory.p.smith, htgoebel, pitrou, r.david.murray, methane, serhiy.storchaka, anton.barkovsky, josh.r, andrei.avk, kamilturek |
2021-08-16 11:51:11 | sblondon | set | messageid: <1629114671.02.0.402850918261.issue15373@roundup.psfhosted.org> |
2021-08-16 11:51:11 | sblondon | link | issue15373 messages |
2021-08-16 11:51:10 | sblondon | create | |
|