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 7077053
In Process

The Archive Base Latest Questions

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

Related: What is the common header format of Python files? Where can I find

  • 0

Related: What is the common header format of Python files?

Where can I find a list of all double-underscore variables that are commonly used in Python?

In Python, variables starting and ending with double underscores are typically to store metadata or are built into the system. For example,

#!/usr/bin/env python

__author__ = 'Michael0x2a'
__license__ = 'GPL'

class Test(object):
    def __init__(self):
        print 'Hello World!'

if __name__ == '__main__':
    t = Test()

I’m pretty certain __author__ and __license__ are pretty well known. What other double-underscore metadata variables are there? Is there a comprehensive list I can check somewhere? Can I just make up my own, or are there a bunch of ones that have become de-facto standards that I should use?

Things like __init__, __name__, and __doc__ are pretty much built into Python. Are those the only reserved double-underscore variables? Are there any more? Is there some place I can get a list?

[Edit]
I was browsing and encountered another question that linked to a mindmap of a bunch of double-underscore variables.

  • 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-28T06:22:31+00:00Added an answer on May 28, 2026 at 6:22 am

    If you want to see magic names whether documented or not, go to the Lib directory and run:

    egrep -oh '__[A-Za-z_][A-Za-z_0-9]*__' *.py | sort | uniq
    

    That produces:

    '__all__'
    '__args__'
    '__author__'
    '__bases__'
    '__builtin__'
    '__builtins__'
    '__cached__'
    '__call__'
    '__class__'
    '__copy__'
    '__credits__'
    '__date__'
    '__decimal_context__'
    '__deepcopy__'
    '__dict__'
    '__doc__'
    '__exception__'
    '__file__'
    '__flags__'
    '__ge__'
    '__getinitargs__'
    '__getstate__'
    '__gt__'
    '__import__'
    '__importer__'
    '__init__'
    '__ispkg__'
    '__iter__'
    '__le__'
    '__len__'
    '__loader__'
    '__lt__'
    '__main__'
    '__module__'
    '__mro__'
    '__name__'
    '__package__'
    '__path__'
    '__pkgdir__'
    '__return__'
    '__safe_for_unpickling__'
    '__setstate__'
    '__slots__'
    '__temp__'
    '__test__'
    '__version__'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Related to https://stackoverflow.com/questions/139944/where-can-one-find-free-software-icons-images I have a need for free weather-related icons. Specifically, I need
Is there a common method/best practice/any means for combining forms that span multiple related
I'm looking into creating a library for myself that handles common internet-related functions. So
Common image questions in regards to developing WP7 applications which are all related to
I have 2 Java EE applications which need to share some common user related
I have two tables, related by a common key. So TableA has key AID
We put common prefixes on related tables to assure they display next to each
I have two related classes which share a common interface and are both stored
I have two models that are not related (in the db sense) but have
I have a few related applications that I want to deploy to different computers.

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.