Skip to content

Instantly share code, notes, and snippets.

@fmayer
Created October 24, 2012 16:30
Show Gist options
  • Save fmayer/3947158 to your computer and use it in GitHub Desktop.
Save fmayer/3947158 to your computer and use it in GitHub Desktop.
>>> class Yes(str):
... def __eq__(self, o): return True
>>> "__main__" == Yes("foo")
True
>>> "__main__".__eq__(Yes("foo"))
False
>>> class Str(str):
... pass
>>> Str("__main__") == Yes("foo")
False
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment