Skip to content

Commit

Permalink
Merge pull request #881 from asottile/better-union-register
Browse files Browse the repository at this point in the history
slightly cleaner plugin union registering
  • Loading branch information
asottile authored Aug 29, 2023
2 parents 5b516cf + 82bbb9a commit c21b4c4
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions pyupgrade/_plugins/typing_pep563.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,8 @@ def _visit_func(
yield from _replace_string_literal(node.returns)


@register(ast.AsyncFunctionDef)
def visit_AsyncFunctionDef(
state: State,
node: ast.AsyncFunctionDef,
parent: ast.AST,
) -> Iterable[tuple[Offset, TokenFunc]]:
yield from _visit_func(state, node, parent)


@register(ast.FunctionDef)
def visit_FunctionDef(
state: State,
node: ast.FunctionDef,
parent: ast.AST,
) -> Iterable[tuple[Offset, TokenFunc]]:
yield from _visit_func(state, node, parent)
register(ast.AsyncFunctionDef)(_visit_func)
register(ast.FunctionDef)(_visit_func)


@register(ast.AnnAssign)
Expand Down

0 comments on commit c21b4c4

Please sign in to comment.