-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Any
types for tuple except handler tests
#1639
Allow Any
types for tuple except handler tests
#1639
Conversation
|
||
all_types = [] # type: List[Type] | ||
test_types = type.items if isinstance(type, TupleType) else [type] | ||
|
||
for ttype in test_types: | ||
if isinstance(ttype, AnyType): | ||
all_types.append(ttype) |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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
.
Looks good, thanks! |
Thanks @ddfisher! |
Fixes #1635.