Skip to content

Commit

Permalink
Merge pull request #850 from asottile/typevar-bounds-always-unquote
Browse files Browse the repository at this point in the history
3.12 TypeVar bounds are always unquotable
  • Loading branch information
asottile committed Jul 1, 2023
2 parents b8aa8c0 + 07ff314 commit 7003579
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions pyupgrade/_plugins/typing_pep563.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,5 @@ def visit_TypeVar(
node: ast.TypeVar,
parent: ast.AST,
) -> Iterable[tuple[Offset, TokenFunc]]:
if not _supported_version(state):
return
if node.bound is not None:
yield from _replace_string_literal(node.bound)
4 changes: 0 additions & 4 deletions tests/features/typing_pep563_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
'x: Annotated[1:2] = ...\n',
id='Annotated with invalid slice',
),
pytest.param(
'def f[X: "int"](x: X) -> X: return x\n',
id='TypeVar quoted bound but no __future__ annotations',
),
pytest.param(
'from __future__ import annotations\n'
'def f[X](x: X) -> X: return x\n',
Expand Down

0 comments on commit 7003579

Please sign in to comment.