I was wondering why when I run a python script like the one showed below, the interpreter prints the print that is inside the class even if the class has not been instantiated.
AFAIK, python first reads what is global, then it goes to the main method and from there it can call other objects.
print "BRAVO 1"
class Foo():
print "BRAVO 2"
def __init__(self):
print "BRAVO 3"
print "BRAVO 4"
if __name__ == "__main__":
print "BRAVO MAIN"
prints
BRAVO 1
BRAVO 2
BRAVO 4
BRAVO MAIN