Skip to content

Instantly share code, notes, and snippets.

@rossdylan
Created January 17, 2013 19:18
Show Gist options
  • Save rossdylan/4558747 to your computer and use it in GitHub Desktop.
Save rossdylan/4558747 to your computer and use it in GitHub Desktop.
make the '_' variable match anything and everything.
"""
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