Commit c444466
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 c444466
2 files changed
+9
-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 | + | |
| 1813 | + | |
1812 | 1814 | | |
1813 | 1815 | | |
1814 | 1816 | | |
| |||
1819 | 1821 | | |
1820 | 1822 | | |
1821 | 1823 | | |
| 1824 | + | |
| 1825 | + | |
1822 | 1826 | | |
1823 | 1827 | | |
1824 | 1828 | | |
1825 | 1829 | | |
1826 | 1830 | | |
1827 | 1831 | | |
1828 | 1832 | | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
1829 | 1837 | | |
1830 | 1838 | | |
1831 | 1839 | | |
| |||
0 commit comments