Usage of main()

Jan Kaliszewski zuo at chopin.edu.pl
Fri Sep 4 06:43:05 EDT 2009


> So yes, depending on the nature of your code, its quite conceivable to
> find distinct performance differences between code using the __main__
> idiom and code without.

But -- it should be emphasized -- it's faster thanks to running code
(an doing name lookups) within a function, and *not* thanks to using
the __main__ idiom (i.e. 'if __name__ == "__main__":' condition).

Cheers,
*j

-- 
Jan Kaliszewski (zuo) <zuo at chopin.edu.pl>



More information about the Python-list mailing list