Author: guido.van.rossum
Date: Wed Jun 13 23:52:41 2007
New Revision: 55965

Modified:
   python/branches/py3k-struni/Lib/os.py
Log:
Reduce redundant calls to str() in _Environ class.


Modified: python/branches/py3k-struni/Lib/os.py
==============================================================================
--- python/branches/py3k-struni/Lib/os.py       (original)
+++ python/branches/py3k-struni/Lib/os.py       Wed Jun 13 23:52:41 2007
@@ -424,8 +424,9 @@
         def __getitem__(self, key):
             return self.data[self.keymap(key)]
         def __setitem__(self, key, value):
-            self.putenv(key, str(value))
-            self.data[self.keymap(key)] = str(value)
+            value = str(value)
+            self.putenv(key, value)
+            self.data[self.keymap(key)] = value
         def __delitem__(self, key):
             self.unsetenv(key)
             del self.data[self.keymap(key)]
@@ -438,7 +439,7 @@
             return dict(self)
         def setdefault(self, key, value):
             if key not in self:
-                self[key] = str(value)
+                self[key] = value
             return self[key]
 
     try:
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to