Skip to content

Instantly share code, notes, and snippets.

@westurner
Created January 26, 2017 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save westurner/445378aa181d0306e633e022f2115b26 to your computer and use it in GitHub Desktop.
Save westurner/445378aa181d0306e633e022f2115b26 to your computer and use it in GitHub Desktop.
def search_operators(str_):
matches = []
for thing in [[x, getattr(int, x).__doc__] for x in dir(int) if x.startswith('__')]:
print((">>>>", (thing[0], thing[1])))
if thing[1] is not None and "<==>" in thing[1]:
print(('<==>', thing[1].split(" <==> ")[::-1]))
if str_ in thing[1]:
matches.append(thing)
print('')
print(('match', thing[1]))
print('')
return matches
search_operators('//')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment