Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7496193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:31:28+00:00 2026-05-29T18:31:28+00:00

If I print os.environ , the output looks like a dictionary. Some posts I

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:31:30+00:00Added an answer on May 29, 2026 at 6:31 pm
    >>> os.environ.__class__
    <class os._Environ at 0xb7865e6c>
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider: print $foo, AAAAAAAA, $foo, BBBBBBBB; Let's say I want to use this code
I have filter that I took from django but now I must import too
Using this code, many keys are output, but I expected no output: import os
I know that there are plenty of similar questions on stack overflow. But the
How to print the environment variables in a C program using environ . extern
Let's say I have a basic Python script, test.py : #!/usr/bin/python print Content-type: text/html\n\n
What could be the cause that os.environ does not contain the HOST environment variable
this may seem like a very basic question, but i have difficulty grasping it,
Print all 12 verses of the popular holiday song . By 12 verses I
print <ul>; foreach ($arr as $value) { echo(<li> . $value[storeid] . . ($value[dvdstock] +

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.