Skip to content

Instantly share code, notes, and snippets.

@ashwin
Created May 3, 2012 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashwin/2589900 to your computer and use it in GitHub Desktop.
Save ashwin/2589900 to your computer and use it in GitHub Desktop.
Function name in Python
def squareIt( x ):
return x * x
print( squareIt.__name__ ) # squareIt
foo = squareIt
print( foo.__name__ ) # squareIt
squareIt = lambda x: x * x
print( squareIt.__name__ ) # <lambda>
foo = squareIt
print( foo.__name__ ) # <lambda>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment