Skip to content

Commit

Permalink
Update pylint/checkers/base/name_checker/checker.py
Browse files Browse the repository at this point in the history
Co-authored-by: Pierre Sassoulas <[email protected]>
  • Loading branch information
DanielNoord and Pierre-Sassoulas authored Mar 23, 2023
1 parent e76c3cc commit e53297a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pylint/checkers/base/name_checker/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,10 @@ def _assigns_typealias(node: nodes.NodeNG | None) -> bool:
# Union is a special case because it can be used as a type alias
# or as a type annotation. We only want to check the former.
assert node is not None
if (
return not (
isinstance(node.parent, nodes.AnnAssign)
and node.parent.value is not None
):
return False
return True
)
elif isinstance(inferred, nodes.FunctionDef):
if inferred.qname() == "typing.TypeAlias":
return True
Expand Down

0 comments on commit e53297a

Please sign in to comment.