top | item 18088861

(no title)

typomatic | 7 years ago

Modules and functions in Python have a __name__ attribute. If you've used Python for scripts, you've probably written `if __name__ == "__main__":` at some point, which is the module name for executed scripts, whereas imported modules get their proper name.

Similarly, Python basically keeps track of "proper" names for proper functions, but can't/won't do so for lambdas.

discuss

order

No comments yet.