-
Notifications
You must be signed in to change notification settings - Fork 96
Improve suggestion for finding max and min using semver #337
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
Conversation
Thank you very much @mzjp2 and welcome! Much appreciated. π For some reason, there is an (unrelated) issue about the typing module. I'm not sure about the problem. @tlaferriere as you are more experienced than I am regarding typing, could you have a look, please? After the problem is fixed, I'd like to merge it. If you have further ideas, don't hesitate, just submit your suggestions. Thank you! |
Thank you for the fix! |
@mzjp2 @tlaferriere I've played a bit with the type definitions. For some reason, mypy seems to detect an error. I remember, this was different in the past, so they changed something. To avoid such thing in the future, maybe it would be useful to freeze the version. I've introduced a new type Feel free to suggest a better name or handling. |
Sounds good to me - happy for you to merge whenever you want :) |
Let's wait some more day, so Thomas has some time to look into it. π |
I'll look into this tomorrow, today I have an exam. |
Good luck with the exam! Keep my fingers crossed. π€ |
Good luck indeed!
β¦ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define new type "Decorator" for function "deprecated" to avoid this mypy error: src/semver/_deprecated.py:69: error: Incompatible return value type (got "Callable[[VarArg(Any), KwArg(Any)], Callable[..., F]]", expected "Union[Callable[..., F], partial[Any]]") Co-authored-by: Thomas Laferriere <[email protected]>
Thanks Thomas and Zain for your contribution, much appreciated! π β€οΈ |
Thanks all! |
I was reading through the documentation and thought that the suggestion for finding max/min of a list/iterable of strings using
semver
unecessarily complicated, with amap
, and multiple typecasts. I think using justmax
withkey
as done in this PR is much cleaner and should be the de-facto suggestion.This is my first contribution to this repository, I hope it's welcome and I've followed the contribution guide well - but feel free to let me know if I can improve anything or close this PR if it's unwanted :)