Last active
October 26, 2015 22:03
-
-
Save dwinter/16b12ba488aef1299631 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def square_docs(f): | |
f.__doc__ = "Square it" | |
return(f) | |
@square_docs | |
def square(x): | |
return(x**2) | |
help(square) | |
#Type: function | |
#String form: <function square at 0x7f7c8b0c0500> | |
#File: ... | |
#Definition: square(x) | |
#Docstring: Square it | |
square(2) | |
#4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment