diff --git a/mypy/constraints.py b/mypy/constraints.py index 699c320daaa0..542ddab54e09 100644 --- a/mypy/constraints.py +++ b/mypy/constraints.py @@ -163,10 +163,7 @@ def visit_partial_type(self, template: PartialType) -> List[Constraint]: # Non-trivial leaf type def visit_type_var(self, template: TypeVarType) -> List[Constraint]: - if self.actual: - return [Constraint(template.id, self.direction, self.actual)] - else: - return [] + return [Constraint(template.id, self.direction, self.actual)] # Non-leaf types diff --git a/mypy/nodes.py b/mypy/nodes.py index 89ddb76e5469..cde6e0ce39fc 100644 --- a/mypy/nodes.py +++ b/mypy/nodes.py @@ -1776,7 +1776,7 @@ def fullname(self) -> str: def is_generic(self) -> bool: """Is the type generic (i.e. does it have type variables)?""" - return self.type_vars is not None and len(self.type_vars) > 0 + return len(self.type_vars) > 0 def get(self, name: str) -> 'SymbolTableNode': for cls in self.mro: