We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing from typing_extensions instead of typing gives some errors with ruff version 0.0.94
typing_extensions
typing
from typing_extensions import Literal, List from pydantic import BaseModel from dataclasses import dataclass f821_outer = Literal['x'] # No errors f722_outer = Literal['+', "-"] # No errors f821_List = List[Literal['x']] # No errors f722_List = List[Literal['+','-']] # No errors class Tmp(BaseModel): a: Literal['x'] # F821 Undefined name `x` b: Literal['+', "-"] # F722 Syntax error in forward annotation: `+`, # F722 Syntax error in forward annotation: `-` c: List[Literal['x']] # F821 Undefined name `x` d: List[Literal['+','-']] # F722 Syntax error in forward annotation: `+`, # F722 Syntax error in forward annotation: `-` e: f821_outer # No errors f: f722_outer # No errors @dataclass class Tmp1: a: Literal['x'] # F821 Undefined name `x` b: Literal['+', "-"] # F722 Syntax error in forward annotation: `+`, # F722 Syntax error in forward annotation: `-` c: List[Literal['x']] # F821 Undefined name `x` d: List[Literal['+','-']] # F722 Syntax error in forward annotation: `+`, # F722 Syntax error in forward annotation: `-` e: f821_outer # No errors f: f722_outer # No errors def tmp( a: Literal['x'], # F821 Undefined name `x` b: Literal['+', "-"], # F722 Syntax error in forward annotation: `+`, # F722 Syntax error in forward annotation: `-` c: List[Literal['x']], # F821 Undefined name `x` d: List[Literal['+','-']], # F722 Syntax error in forward annotation: `+`, # F722 Syntax error in forward annotation: `-` e: f821_outer, # No errors f: f722_outer, # No errors ): pass
yields
Found 18 error(s). f821.py:11:15: F821 Undefined name `x` f821.py:12:15: F722 Syntax error in forward annotation: `+` f821.py:12:20: F722 Syntax error in forward annotation: `-` f821.py:13:20: F821 Undefined name `x` f821.py:14:20: F722 Syntax error in forward annotation: `+` f821.py:14:24: F722 Syntax error in forward annotation: `-` f821.py:20:15: F821 Undefined name `x` f821.py:21:15: F722 Syntax error in forward annotation: `+` f821.py:21:20: F722 Syntax error in forward annotation: `-` f821.py:22:20: F821 Undefined name `x` f821.py:23:20: F722 Syntax error in forward annotation: `+` f821.py:23:24: F722 Syntax error in forward annotation: `-` f821.py:28:15: F821 Undefined name `x` f821.py:29:15: F722 Syntax error in forward annotation: `+` f821.py:29:20: F722 Syntax error in forward annotation: `-` f821.py:30:20: F821 Undefined name `x` f821.py:31:20: F722 Syntax error in forward annotation: `+` f821.py:31:24: F722 Syntax error in forward annotation: `-`
When changing the import from typing_extensions to typing I get 0 errors. When using ruff version 0.0.93 I get 0 errors (using either import)
The text was updated successfully, but these errors were encountered:
Thank you! Will fix this today.
Sorry, something went wrong.
Thanks for this and apologies for the oversight. This is going out in v0.0.95 (building now).
No worries, I can hardly complain when there's a fix two hours after reporting.
Successfully merging a pull request may close this issue.
Importing from
typing_extensions
instead oftyping
gives some errors with ruff version 0.0.94yields
When changing the import from
typing_extensions
totyping
I get 0 errors.When using ruff version 0.0.93 I get 0 errors (using either import)
The text was updated successfully, but these errors were encountered: