Created
June 16, 2018 02:46
-
-
Save rnagasam/d2bdb911b87ec457b1a9f39f632717b8 to your computer and use it in GitHub Desktop.
Forbidden Fruit is one crafty library
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
from forbiddenfruit import curse, reverse | |
# add method to int type | |
def words_of_wisdom(self): | |
return self * "blah " | |
curse(int, "words_of_wisdom", words_of_wisdom) | |
# add classmethod | |
def hello(self): | |
return "blah" | |
curse(str, "hello", classmethod(hello)) | |
# remove the curse | |
reverse(str, "hello") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment