Custom Search

Friday, April 2, 2010

The special ’__xxx__’ variables in python

The special ’__xxx__’ variables in python

• In Python, the variable names ’__xxx__’ are special
• Two underscores ’_’ at each end of a word
• Some are created automatically during execution
__name__, __file__, __doc__, __builtins__
• Some control the execution in different ways
• Only set the value of one when you know what you are doing!
• Don’t use this type of name for your own stuff!

No comments:

Post a Comment