Skip to content

Instantly share code, notes, and snippets.

@refi64
Last active August 29, 2015 14:23
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save refi64/5fad06f7a70e6420bb8c to your computer and use it in GitHub Desktop.
Save refi64/5fad06f7a70e6420bb8c to your computer and use it in GitHub Desktop.
def fuzzyfinder(p, l):
return map(lambda t: t[0], sorted(filter(lambda t: all(map(lambda x: x != -1, t[1])), map(lambda s: (s,map(s.find, p)), l)), key=lambda t: t[1]))
@noodlebreak
Copy link

Very bad readability.
Violates the zen of Python.

Besides, there's an error here:

TypeError: unorderable types: map() < map()

@refi64
Copy link
Author

refi64 commented Jun 27, 2015

@noodlebreak Well, I typed this on a phone in a web REPL. ;)

Also, I don't get an error!?

@bofm
Copy link

bofm commented Jul 12, 2015

Python 3 gives the error

@wangst321
Copy link

yeap, python 3 gives an error::

TypeError: unorderable types: map() < map()

BTW, i think it has a big problem, for repeat character in p, find() return the same pos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment