Skip to content

Improve min/max #2833

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

Merged
merged 4 commits into from
Mar 8, 2019
Merged

Improve min/max #2833

merged 4 commits into from
Mar 8, 2019

Conversation

kaste
Copy link
Contributor

@kaste kaste commented Mar 8, 2019

Probably mildly clear if you provide a default value for min/max builtins the return type becomes a 'Union'.

I don't know if that's too much but I also added two other commits (you squash anyway, cherry-pick) because in the recent mypy we can mark positional args via '_' and of course kw only args via '*'.

I didn't find tests. It's also really hard to write this without typos because it's so ... dense. 🤞 hope it helps.

Fixes python/mypy#6460

@kaste kaste changed the title Improve min max Improve min/max Mar 8, 2019
Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix!

@srittau srittau merged commit 4dcd516 into python:master Mar 8, 2019
@kaste kaste deleted the improve-min-max branch March 8, 2019 19:12
msullivan added a commit that referenced this pull request Mar 25, 2019
PR #2833 introduced more flexible handling for the type of the default
parameter, but the extra type variable caused some issues. Add another
overload for the case where there is no default param.

This is I think related to the issues we have had with `get` recently?
msullivan added a commit that referenced this pull request Mar 25, 2019
PR #2833 introduced more flexible handling for the type of the default
parameter, but the extra type variable caused some issues. Add another
overload for the case where there is no default param.

This is I think related to the issues we have had with `get` recently?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants