Python bugs

Fred L. Drake, Jr. fdrake at acm.org
Mon Nov 29 23:02:38 CET 1999


Skip said:
 > I believe os.environ is a class to allow constructs like
 > 
 >     os.environ["FOO"] = "PYTHON"
 > 
 > to work like
 > 
 >     os.putenv("FOO", "PYTHON")

Bjorn Pettersen writes:
 > Which is a good thing, but shouldn't preclude it from being used as a
 > dictionary in the update statement (although the fix probably have to be to
 > Dict.update rahter than os.environ).

  Very much so.  os.environ does exactly the right thing; {}.update is 
simply too simple.  ;-)  Shouldn't be had to fix, given a little
motivation.  The implementation should retain the special case of
"real" dictionaries, but also implement a generic version that uses
the mapping API.
  I'm sure Guido would be glad to receive a patch.  ;-)  ;-)


  -Fred

--
Fred L. Drake, Jr.	     <fdrake at acm.org>
Corporation for National Research Initiatives




More information about the Python-list mailing list