Skip to content

Commit

Permalink
Allow isinstance/issubclass with nested tuples
Browse files Browse the repository at this point in the history
  • Loading branch information
pkch committed Mar 14, 2017
1 parent 81df467 commit aa15f40
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2693,12 +2693,12 @@ def flatten(t: Expression) -> List[Expression]:


def get_isinstance_type(expr: Expression, type_map: Dict[Expression, Type]) -> Type:
type = type_map[expr]
all_types = [type_map[e] for e in flatten(expr)]

if isinstance(type, TupleType):
all_types = type.items
else:
all_types = [type]
#if isinstance(type, TupleType):
#all_types = type.items
#else:
#all_types = [type]

types = [] # type: List[Type]

Expand Down

0 comments on commit aa15f40

Please sign in to comment.