[ty] don't allow first-party code to shadow stdlib types module (#19128)

This commit is contained in:
Carl Meyer
2025-07-04 03:36:26 -07:00
committed by GitHub
parent 25bdb67d9a
commit 7712c2fd15
3 changed files with 28 additions and 10 deletions

View File

@@ -205,3 +205,18 @@ python-version = "3.13"
import aifc # error: [unresolved-import]
from distutils import sysconfig # error: [unresolved-import]
```
## Cannot shadow core standard library modules
`types.py`:
```py
x: int
```
```py
# error: [unresolved-import]
from types import x
from types import FunctionType
```