SethMMorton / fastnumbers

Super-fast and clean conversions to numbers for Python.
https://pypi.org/project/fastnumbers/
MIT License
105 stars 13 forks source link

Rename "key" option to "on_fail" #32

Closed SethMMorton closed 4 years ago

SethMMorton commented 4 years ago

The key option to the fast_* functions is intended to be executed when the input cannot be converted. key is usually something that is executed before the algorithm, not after, so this name has always been a bother. I think on_fail is more descriptive of when the function is executed.

key will remain valid but deprecated/discouraged. If both key and on_fail are given, an error will be raised.