Skip to content

sys: refine the return type of sys.exc_info() #3111

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

Merged
merged 1 commit into from
Jul 11, 2019

Conversation

bluetech
Copy link
Contributor

I believe that either all of the items are None or none of them are.
Reflect that in the type.

This was attempted initially in
#246
but apparently mypy didn't allow unpacking given such a union, but it
does now (checked with mypy 0.711).

The (incorrect) TODO from that PR was removed in commit
25ac4d6 but the commit message noted
that this change is desirable.

I believe that either all of the items are None or none of them are.
Reflect that in the type.

This was attempted initially in
python#246
but apparently mypy didn't allow unpacking given such a union, but it
does now (checked with mypy 0.711).

The (incorrect) TODO from that PR was removed in commit
25ac4d6 but the commit message noted
that this change is desirable.
@bluetech
Copy link
Contributor Author

In the referenced commit message, @srittau suggested using a generic (presumably bounded by BaseException) instead of using BaseException directly. But I'm not sure that this would be better - sounds a bit unsafe?

@srittau srittau merged commit 4ae4714 into python:master Jul 11, 2019
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