Skip to content

Instantly share code, notes, and snippets.

@rnagasam
Created June 16, 2018 02:46
Show Gist options
  • Save rnagasam/d2bdb911b87ec457b1a9f39f632717b8 to your computer and use it in GitHub Desktop.
Save rnagasam/d2bdb911b87ec457b1a9f39f632717b8 to your computer and use it in GitHub Desktop.
Forbidden Fruit is one crafty library
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