Description
I know this smells like an anti-pattern and I personally don't like it, but the same pattern seems to work under Mypy and (older version of) Pyright so it gets hard to justify for a "fix" specifically for basedpyright and is probably worth looking into.
Minimum example: Refer below as Playground does not support multiple files.
Create 2 files in a Python package, common.py and repro.py
Content in common.py:
import typing as t
MyInt = t.NewType('MyInt', int)
Content in repro.py:
import typing as t # Same name as the common import
from .common import *
reveal_type(t.Any) # Type of "t.Any" is "Unknown"
reveal_type(MyInt) # Type of "MyInt" is "type[MyInt]"
Does the issue also occur in Pyright? Doesn't seem like it. Tested under Pyright v1.1.402 (the last usable version available on open-vsx). Yes it does on Pyright v1.1.411 all vanilla config.
Description
I know this smells like an anti-pattern and I personally don't like it, but the same pattern seems to work under Mypy and (older version of) Pyright so it gets hard to justify for a "fix" specifically for basedpyright and is probably worth looking into.
Minimum example: Refer below as Playground does not support multiple files.
Create 2 files in a Python package,
common.pyandrepro.pyContent in
common.py:Content in
repro.py:Does the issue also occur in Pyright?
Doesn't seem like it. Tested under Pyright v1.1.402 (the last usable version available on open-vsx).Yes it does on Pyright v1.1.411 all vanilla config.