Commit 8a6ea89
committed
Do not consider ‘import a.b as b’ an explicit reexport
The point of the ‘import a as a’ and ‘from a import b as b’ syntax for
explicit reexport is that it indicates an intention to do something
different from the ordinary ‘import a’ and ‘from a import b’.
That is not the case with ‘import a.b as b’. Even mypy’s own code
includes ‘import mypy.types as types’, which was not intended to be a
reexport; if it were, it would be written ‘from mypy import types as
types’.
Pyright agrees that ‘import a.b as b’ should not reexport.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>1 parent 47a435f commit 8a6ea89
2 files changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2230 | 2230 | | |
2231 | 2231 | | |
2232 | 2232 | | |
2233 | | - | |
| 2233 | + | |
2234 | 2234 | | |
2235 | 2235 | | |
2236 | 2236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1809 | 1809 | | |
1810 | 1810 | | |
1811 | 1811 | | |
| 1812 | + | |
1812 | 1813 | | |
1813 | 1814 | | |
1814 | 1815 | | |
| |||
1819 | 1820 | | |
1820 | 1821 | | |
1821 | 1822 | | |
| 1823 | + | |
1822 | 1824 | | |
1823 | 1825 | | |
1824 | 1826 | | |
| |||
0 commit comments