Created
December 4, 2018 23:08
-
-
Save bjonnh/4b80553392aa6fad496593437732d70a to your computer and use it in GitHub Desktop.
Replacing code of function in python
This file contains 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 fix(): | |
print("Damn") | |
def fox(): | |
print("in socks") | |
fix.__code__ = fox.__code__ | |
fix() | |
# in socks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment