[Tutor] os.environ weirdness
Poor Yorick
gp@pooryorick.com
Mon Dec 9 21:32:02 2002
Another phenomenon I haven't made sense of:
>>> for i in os.environ:
print i
Traceback (most recent call last):
File "<pyshell#13>", line 1, in ?
for i in os.environ:
File "C:\Python22\lib\os.py", line 387, in __getitem__
return self.data[key.upper()]
AttributeError: 'int' object has no attribute 'upper'
I realize that os.environ is not a builtin dictionary, but some sort of
subclassed dictionary, but these commands work:
os.environ.keys()
os.environ.items()
doesn't the "in" statement just resolve to one of those functions?
Regards,
Poor Yorick
gp@pooryorick.com