-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New semantic analyzer: possible cyclic definition for ignored recursive type #7069
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
Comments
This is a known limitation. In the process of migrating to new analyzer we dropped some partial support of recursive types. It will be brought back in near future (in the form of general recursive types support). |
Can't wait! We like to use this for our serializable structures as well. |
Known to whom? Can the mypy FAQ document this? |
Is there a tracker so that people can find out when this will be resolved? Having the ticket closed suggests that there's no additional work to be done? |
We are using a type definition that looks like this for returning dicts that should be JSON serializable:
Without the new semantic analyzer this passes and gives errors for dicts with incorrectly typed values one level down.
However with the new semantic analyzer this breaks on both the definition of the type:
And on imports of the type in other modules:
This is when using stable mypy from PyPI (
mypy 0.711
) withmypy --new-semantic-analyzer .
and the following settings:I am aware that recursive types are not yet supported, but I still thought it was worth reporting this as it's a feature regression.
The text was updated successfully, but these errors were encountered: