Skip to content

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