-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type hints #132
Comments
def natsort(seq: Iterable[Any], key: Callable[[Any], Any], reverse: bool, alg: int): -> List[Any]:
... Having said that - I am not against it. Is this something you are willing to submitting a PR to implement? |
Not in the short term, but knowing it would be welcomed, in time I might. By the way, typing that function would become a lot more useful with generics. |
If anyone wants a starting point I made domdfcoding/natsort-stubs for my own use. Feel free to use them. I think I made with with mypy's stubgen and added what else I could infer by hand. The only issue I ran into was with the |
So, I recently started using Based on my reading, it looks like all I have to do is add the annotations in-code, and then create a (blank) file called |
@domdfcoding Thanks - this will be useful to get me started. |
@SethMMorton I have issued a PR that is working for me (only on Python 3.7+, for <3.7 it needs to be typing_extensions instead of typing). You can take a look at it and implement something similar! |
@domdfcoding This is amazing. I will shamelessly steal a lot of your work :) |
Closed with #138. |
Congratulations on getting this done so swiftly! |
The library does not yet provide type hints for use with Mypy for example. It would be great to get rid of
# type: ignore
and enjoy the additional safety.The text was updated successfully, but these errors were encountered: