Skip to content

no-implicit-reexport resolves implicit re-exports as Any #12749

@DetachHead

Description

@DetachHead
# foo.py
class Foo:
    ...
# bar.py
from foo import Foo
# baz.py
from bar import Foo # Module "bar" does not explicitly export attribute "Foo"; implicit reexport disabled  [attr-defined]

reveal_type(Foo) # Revealed type is "Any"

mypy should still resolve the import like it does when no-implicit-reexport is disabled.

in my case, i'm trying to use a library that imports its own classes using implicit re-exports, which results in pretty much everything being treated as Any in my project

#12749 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions