What is the purpose of python variables __something__
e.g. __name__, __file__
I often see them in real python programs.
Is there a list of these variables?
thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
PEP8 covers this:
The final bullet point is pertinent.
I doubt that there is an official list of all such double leading and trailing underscore names, but I could not say so for sure.