If I print os.environ, the output looks like a dictionary. Some posts I read online say that it is a memory based dictionary.
But it does not support .viewkeys() method and tells me that: _Environ instance does not support this method. So what is the exact type of os.environ. If I try:
print type(os.environ)
I get instance as the answer.
Can please clarify this behavior of os.environ?
It is a subclass of UserDict.IterableUserDict.
In python 2.7 the source can be found is in os.py on line 413 (Windows) and line 466 (Posix). Here is the python 3.2 source.