I have a class that does nothing:
class nothing():
pass
when I print the type of my class:
p1 = nothing()
print(type(p1))
I get:
<class '__main__.nothing'>
What is the meaning of '__main__'?
I have a class that does nothing:
class nothing():
pass
when I print the type of my class:
p1 = nothing()
print(type(p1))
I get:
<class '__main__.nothing'>
What is the meaning of '__main__'?
I found a definition of __main__ https://docs.python.org/3/library/__main\__.html
'__main__' is the name of the scope in which top-level code executes. A module’s __name__ is set equal to '__main__' when read from standard input, a script, or from an interactive prompt.
so basically it means you made you defined that class in the file that you ran with python.