fuzzywuzzy icon indicating copy to clipboard operation
fuzzywuzzy copied to clipboard

Add allow_key decorator to accept object

Open dumbPy opened this issue 4 years ago • 0 comments

Add allow_key decorator that would allow passing objects into fuzzywuzzy functions.
This should help using fuzzywuzzy in more cleaner way like the test cases added.
similar to how you can pass objects into sort/max/min functions and use a key:Callable[[Any],number] to get the numbers to use.

Would be trivial to add to simple functions like fuzz.ratio. Not added to any functions. That can be discussed further and then decided. Might need more consideration for more complicated functions that don't follow Callable[[str,...],int] signature

dumbPy avatar Aug 10 '20 16:08 dumbPy