Skip to content
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

Now *CustomType and **CustomType arguments are properly checked #11151

Merged
merged 8 commits into from
Oct 31, 2021
Merged

Now *CustomType and **CustomType arguments are properly checked #11151

merged 8 commits into from
Oct 31, 2021

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Sep 20, 2021

The thing about this patch is that ArgTypeExpander needed mapping_type and iterable_type for checking * and ** arguments.

But, this context was not provided.
I've also fixed a bunch of related TODO items.

Closes #11144
Closes #11138
Closes #11375

@sobolevn sobolevn changed the title Now **CustomType argument is properly checked Now *CustomType and **CustomType argument is properly checked Sep 20, 2021
@sobolevn sobolevn changed the title Now *CustomType and **CustomType argument is properly checked Now *CustomType and **CustomType arguments are properly checked Sep 20, 2021
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

mypy/argmap.py Outdated Show resolved Hide resolved
@github-actions

This comment has been minimized.

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Nice, this was a pretty bad gap in type checking. Left a few comments (not a full review).

test-data/unit/check-kwargs.test Show resolved Hide resolved
mypy/argmap.py Outdated Show resolved Hide resolved
mypy/argmap.py Outdated Show resolved Hide resolved
@sobolevn
Copy link
Member Author

Ok, I am adding #11138 support, it will require a couple of hours.

@sobolevn
Copy link
Member Author

@hauntsaninja any ideas why mypy_primer fails?

@hauntsaninja
Copy link
Collaborator

Just pushed a fix... @msullivan 's hack for edgedb in mypy_primer ended up breaking

@sobolevn sobolevn closed this Sep 29, 2021
@sobolevn sobolevn reopened this Sep 29, 2021
@sobolevn
Copy link
Member Author

@hauntsaninja thank you! 🚀

@sobolevn
Copy link
Member Author

@JukkaL @hauntsaninja is there anything else I can do to get this merged?

Today we got another bugreport about this: #11375

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thanks, this is great!

Wish it was nicer to get the mapping and iterable types

@hauntsaninja hauntsaninja merged commit 8b9ade2 into python:master Oct 31, 2021
@JukkaL JukkaL mentioned this pull request Nov 24, 2021
@JukkaL
Copy link
Collaborator

JukkaL commented Nov 24, 2021

This PR fixed an issue in an internal repo that I just encountered when testing the 0.920 release candidate branch!

@sobolevn
Copy link
Member Author

Awesome! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants