Created
May 15, 2024 09:04
-
-
Save mypy-play/1b48c871277331bf5d0c1a9434057fde to your computer and use it in GitHub Desktop.
Shared via mypy Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Generic, TypeVar | |
T = TypeVar("T") | |
class Foo(Exception, Generic[T]): ... | |
try: | |
raise Foo | |
except Foo[int]: # no error, crashes at runtime | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment