Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions mypy/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion mypy/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down