Skip to content
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

tbtools: Fix typing of current #3013

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

tbtools: Fix typing of current #3013

wants to merge 2 commits into from

Conversation

kevinji
Copy link

@kevinji kevinji commented Dec 11, 2024

This preps for a typing fix in python/typeshed#13231 where __cause__ and __context__ can be None.

This preps for a typing fix in python/typeshed#13231 where `__cause__` and `__context__` can be None.
@kevinji
Copy link
Author

kevinji commented Dec 11, 2024

mypy is probably being too smart and seeing that if current.__cause__ is not None is always True so chained_msg is always a str and not str | None. This will probably be the case until the linked PR is merged. I can explicitly type out with list[tuple[str | None, traceback.TracebackException]] for now if desired.

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.

1 participant