Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
fromtypingimportNewTypeT=NewType('T',str)match'test':caseT(): ...
fails with:
Traceback (most recent call last): File "/tmp/foo.py", line 6, in <module> case T(): ... ^^^TypeError: called match pattern must be a typeThe error message is confusing becauseT is a type. The error message should probably sayclass instead oftype, sinceas per the specification it's a class pattern.