seatgeek/fuzzywuzzy — pull request #69 by nathantypanski (2014-11-30 09:11:02+00:00)
Title: make process.extract accept {dict, list}-like choices

Previously, process.extract expected lists or dictionaries, and tested
this with isinstance() calls. In keeping with the spirit of Python (duck
typing and all that), this change enables one to use extract() on any
dict-like object for dict-like results, or any list-like object for
list-like results.

So now we can (and, indeed, I've added tests for these uses) call
extract() on things like:

- a generator of strings ("any iterable")
- a UserDict
- custom user-made classes that "look like" dicts
(or, really, anything with a .items() method that
behaves like a dict)
- plain old lists and dicts

The behavior is exactly the same for previous use cases of
lists-and-dicts.

This change goes along nicely with PR #68, since those docs suggest
dict-like behavior is valid, and this change makes that true.