-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New semantic analyzer: should we collect functions from AST instead of symbol tables? #6454
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
Labels
Comments
This is something I started to wonder about as well. This may also affect fine-grained incremental mode, and it would be nice if the solution we come up would support that as well. I see three plausible alternatives for how to deal with this:
|
ilevkivskyi
added a commit
that referenced
this issue
Mar 7, 2019
Fixes #6324 This enables two test files that previously had few crashes. Changes in this PR: * Add `defer()` to public plugin API, otherwise dataclasses will not works with forward references. * Update one plugin test to use the new analyzer because the output is a bit more verbose, and probably not worth the hassle of making it identical to old analyzer. * One test is skipped because of existing issue #6454 * Add the generated type variable used for self types to the class body (this is identical to named tuples and `attrs` plugin).
#6783 has a concrete example of a crash with dataclasses that's caused by this. |
PattenR
pushed a commit
to PattenR/mypy
that referenced
this issue
Jun 23, 2019
…es (python#6972) Fixes python#6454. Fixes python#6973. Note that the solution doesn't guarantee the order of numbers N in foo-redefinitionN coincides with the textual order of nodes. But it looks like we don't need this for anything.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Currently, functions are collected for processing from symbol tables, not form ASTs. This causes some issues, for example, if there is method name clash in class-based named tuple, then the user provided method will be not analyzed, which will cause a crash later, see
testNewNamedTupleIllegalNames
.This is a follow-up for #6452
The text was updated successfully, but these errors were encountered: