Skip to content

New analyser: better processing of import cycles with star imports #7141

Closed
@ilevkivskyi

Description

@ilevkivskyi

Consider this test case:

[case testClassDeferredStar]
import lib
[file lib.py]
from other import *

class C:
    x: int
[file other.py]
import lib

Currently the order of processing targets is like this:

  • lib
  • other
  • lib
  • __main__

I think it should be possible to process such SCC without deferral at all. Couple ideas to achieve this:

  • Better ordering of targets within SCC
  • Make missing_names act per namespace (to avoid extra deferral in more complex scenarios)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions