@@ -1611,14 +1611,22 @@ from other_module_2 import a # E: Module "other_module_2" does not explicitly e
1611
1611
reveal_type(a) # N: Revealed type is "builtins.int"
1612
1612
1613
1613
import other_module_2
1614
- # TODO: this should also reveal builtins.int, see #13965
1615
- reveal_type(other_module_2.a) # E: "object" does not explicitly export attribute "a" [attr-defined] \
1616
- # N: Revealed type is "Any"
1614
+ reveal_type(other_module_2.a) # E: Module "other_module_2" does not explicitly export attribute "a" [attr-defined] \
1615
+ # N: Revealed type is "builtins.int"
1616
+
1617
+ from other_module_2 import b # E: Module "other_module_2" does not explicitly export attribute "b" [attr-defined]
1618
+ reveal_type(b) # N: Revealed type is "def (a: builtins.int) -> builtins.str"
1619
+
1620
+ import other_module_2
1621
+ reveal_type(other_module_2.b) # E: Module "other_module_2" does not explicitly export attribute "b" [attr-defined] \
1622
+ # N: Revealed type is "def (a: builtins.int) -> builtins.str"
1617
1623
1618
1624
[file other_module_1.py]
1619
1625
a = 5
1626
+ def b(a: int) -> str: ...
1620
1627
[file other_module_2.py]
1621
- from other_module_1 import a
1628
+ from other_module_1 import a, b
1629
+ [builtins fixtures/module.pyi]
1622
1630
1623
1631
[case testNoImplicitReexportRespectsAll]
1624
1632
# flags: --no-implicit-reexport
@@ -1649,11 +1657,15 @@ __all__ = ('b',)
1649
1657
[case testNoImplicitReexportGetAttr]
1650
1658
# flags: --no-implicit-reexport --python-version 3.7
1651
1659
from other_module_2 import a # E: Module "other_module_2" does not explicitly export attribute "a"
1660
+ reveal_type(a) # N: Revealed type is "builtins.int"
1661
+ from other_module_2 import b # E: Module "other_module_2" does not explicitly export attribute "b"
1662
+ reveal_type(b) # N: Revealed type is "builtins.str"
1652
1663
[file other_module_1.py]
1653
- from typing import Any
1654
- def __getattr__(name: str) -> Any : ...
1664
+ b: str = "asdf"
1665
+ def __getattr__(name: str) -> int : ...
1655
1666
[file other_module_2.py]
1656
- from other_module_1 import a
1667
+ from other_module_1 import a, b
1668
+ def __getattr__(name: str) -> bytes: ...
1657
1669
[builtins fixtures/tuple.pyi]
1658
1670
1659
1671
[case textNoImplicitReexportSuggestions]
0 commit comments