os.environ.copy()['COPY_HUH'] = "not really"

Terry Reedy tjreedy at udel.edu
Wed May 1 12:19:08 EDT 2002


"Alex Martelli" <aleax at aleax.it> wrote in message
news:eCTz8.85568$vF6.2548577 at news2.tin.it...
> Terry Reedy wrote:
>         ...
> > Perhaps os._Environ should have a .dict() method (if is does not
now)
> > to do the conversion.
>
> dict(os.environ) seems a better solution to me.  It's a general way
to
> make a dictionary from any generic mapping, after all.

I thought of this and would agree if dict knows how to handle an
os._Environ object, but I don't know if it does and am not prepared to
test at the moment.

TJR







More information about the Python-list mailing list