Created
January 17, 2013 19:18
-
-
Save rossdylan/4558747 to your computer and use it in GitHub Desktop.
make the '_' variable match anything and everything.
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
""" | |
Author: Ross Delinger (rossdylan) | |
Really useless class that just makes _ equal whatever you throw at it | |
usage: | |
from underscore import _ | |
if [_,_] == [1,"thing"]: | |
print "Anything goes!" | |
else: | |
print "Apprently this doesn't work" | |
""" | |
class __underscore_class__(object): | |
""" | |
Object that matches anything | |
""" | |
def __eq__(self, other): | |
return True | |
""" Actually make _ an importable object """ | |
_ = __underscore_class__() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment