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

New semantic analyzer: Enable namedtuple tests and fix self-check error #6452

Merged
merged 5 commits into from
Feb 21, 2019

Conversation

ilevkivskyi
Copy link
Member

This fixes the Name 'cls' already defined error in self-check with new analyzer. The error is caused by the fact that now we actually analyze generated methods. I solve them simply by using underscored versions of _self and _cls (this is btw the same what runtime implementation does for some generated methods).

I also enable both named tuple test files. This needs the same temporary redundant variable hack as I did for typed dicts, it can be removed when we will not need to be compatible with old analyzer, I will create an issue so we will not forget about this.

I skip a bunch of test cases for recursive named tuples (there is already an issue for this). I also skip one test because it is tricky to fix, I will open a follow-up issue.

@ilevkivskyi
Copy link
Member Author

I will review the tuple PR later today, so that we can enable one more test here, and then will rebase this one (or make a separate PR).

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, more enabled tests cases! I left one minor comment.

mypy/newsemanal/semanal.py Outdated Show resolved Hide resolved
@ilevkivskyi ilevkivskyi merged commit ee1df17 into python:master Feb 21, 2019
@ilevkivskyi ilevkivskyi deleted the fix-cls-named-tuple branch February 21, 2019 17:02
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