Skip to content

New semantic analyzer: better error messages for cyclic cross-module definitions #6551

Description

@ilevkivskyi

This is a follow-up for #6527

The new analyzer gives to verbose (and a bit confusing) error in this case:

[case testNewAnalyzerCyclicDefinitionCrossModule]
import b
[file a.py]
import b
x = b.x  # E: Cannot determine type of 'x'
[file b.py]
import a
x = a.x  # E: Cannot resolve attribute "x", possible cyclic definition \
         # E: Module has no attribute "x"

We can probably skip the second part by injecting a dummy Var with Any type in the a module namespace.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions