mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
30 lines
395 B
Python
30 lines
395 B
Python
"""Test: typing module imports."""
|
|
from foo import cast
|
|
|
|
# OK
|
|
x = cast("Model")
|
|
|
|
from typing import cast
|
|
|
|
|
|
# F821 Undefined name `Model`
|
|
x = cast("Model", x)
|
|
|
|
|
|
import typing
|
|
|
|
|
|
# F821 Undefined name `Model`
|
|
x = typing.cast("Model", x)
|
|
|
|
|
|
from typing import Pattern
|
|
|
|
# F821 Undefined name `Model`
|
|
x = Pattern["Model"]
|
|
|
|
|
|
from typing.re import Match
|
|
|
|
# F821 Undefined name `Model`
|
|
x = Match["Model"]
|