Skip to content

Instantly share code, notes, and snippets.

@mattn
Created July 20, 2011 01:11
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mattn/1094128 to your computer and use it in GitHub Desktop.
class foo:
s = "hello "
pass
foo.__add__ = lambda x, y: x.s + y
f = foo()
print f + "a"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment