Skip to content

Allow Any types for tuple except handler tests - #1639

Merged
ddfisher merged 4 commits into
python:masterfrom
pdmccormick:issue-1635-tuple-except-any-fail
Jun 3, 2016
Merged

ddfisher merged 4 commits into
python:masterfrom
pdmccormick:issue-1635-tuple-except-any-fail

Conversation

@pdmccormick

Copy link
Copy Markdown
Contributor

Fixes #1635.

@pdmccormick

Copy link
Copy Markdown
Contributor Author

@ddfisher

Comment thread mypy/checker.py

for ttype in test_types:
if isinstance(ttype, AnyType):
all_types.append(ttype)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just return AnyType() here instead. UnionType.make_simplified_union returns AnyType if any of the types passed to it are AnyType (as it should).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After looking at your tests, I take it back. The way you're doing it here correctly catches additional non-Exception-derived types that come after an Any.

@ddfisher

ddfisher commented Jun 3, 2016

Copy link
Copy Markdown
Collaborator

Looks good, thanks!

@ddfisher
ddfisher merged commit 89ffeb2 into python:master Jun 3, 2016
@pdmccormick

Copy link
Copy Markdown
Contributor Author

Thanks @ddfisher!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants