-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
needs-infoMore information is needed from the issue authorMore information is needed from the issue author
Description
A minimal code snippet that reproduces the bug:
File test.py
from mytyping import Literal, overload
# from typing import Literal, overload
# from typing_extensions import Literal, overload
tag: Literal["a"] = "a"
@overload
def func(a: int):
...
@overload
def func(a: int, b: int):
...
def func(a: int, b: int = 0):
return a, bFile mytyping.py:
from typing import Literal, overload
__all__ = ["Literal", "overload"]When using ruff check with from mytyping import Literal, overload enabled, I got:
$ ruff check test.py
test.py:5:15: F821 Undefined name `a`
test.py:14:5: F811 Redefinition of unused `func` from line 9
test.py:18:5: F811 Redefinition of unused `func` from line 14
Found 3 errors.However, when uncomment either typing or typing_extensions, ruff check does not report above errors.
Ruff version:
$ ruff --version
ruff 0.0.286Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs-infoMore information is needed from the issue authorMore information is needed from the issue author