Skip to content

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

Merged
hauntsaninja merged 8 commits into
python:masterfrom
sobolevn:issue-11144
Oct 31, 2021
Merged

Now *CustomType and **CustomType arguments are properly checked#11151
hauntsaninja merged 8 commits into
python:masterfrom
sobolevn:issue-11144

Conversation

@sobolevn

@sobolevnsobolevn commented Sep 20, 2021

Copy link
Copy Markdown
Member

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

@sobolevnsobolevn changed the title Now **CustomType argument is properly checkedNow *CustomType and **CustomType argument is properly checkedSep 20, 2021
@sobolevnsobolevn changed the title Now *CustomType and **CustomType argument is properly checkedNow *CustomType and **CustomType arguments are properly checkedSep 20, 2021
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

Comment threadmypy/argmap.py Outdated
@github-actions

This comment has been minimized.

@JukkaLJukkaL left a comment

Copy link
Copy Markdown
Collaborator

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).

Comment threadtest-data/unit/check-kwargs.test
Comment threadmypy/argmap.py Outdated
Comment threadmypy/argmap.py Outdated
@sobolevn

Copy link
Copy Markdown
MemberAuthor

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

@sobolevn

Copy link
Copy Markdown
MemberAuthor

@hauntsaninja any ideas why mypy_primer fails?

@hauntsaninja

Copy link
Copy Markdown
Collaborator

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

@sobolevnsobolevn reopened this Sep 29, 2021
@sobolevn

Copy link
Copy Markdown
MemberAuthor

@hauntsaninja thank you! 🚀

@sobolevn

Copy link
Copy Markdown
MemberAuthor

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

Today we got another bugreport about this: #11375

@hauntsaninjahauntsaninja left a comment

Copy link
Copy Markdown
Collaborator

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:masterOct 31, 2021
@JukkaLJukkaL mentioned this pull request Nov 24, 2021
@JukkaL

JukkaL commented Nov 24, 2021

Copy link
Copy Markdown
Collaborator

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

@sobolevn

Copy link
Copy Markdown
MemberAuthor

Awesome! 🎉

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants

@sobolevn@hauntsaninja@JukkaL@JelleZijlstra