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 3f1e988
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2693,12 +2693,7 @@ def flatten(t: Expression) -> List[Expression]:


def get_isinstance_type(expr: Expression, type_map: Dict[Expression, Type]) -> Type:
type = type_map[expr]

if isinstance(type, TupleType):
all_types = type.items
else:
all_types = [type]
all_types = [type_map[e] for e in flatten(expr)]

types = [] # type: List[Type]

Expand Down

0 comments on commit 3f1e988

Please sign in to comment.