Open
Description
Bug Report
trying to match-case by class collections.abc.Callable
raises
error: Expected type in class pattern; found "typing._SpecialForm" [misc]
To Reproduce
https://mypy-play.net/?mypy=master&python=3.10&gist=29d49c837fadc7e404ea295c82d0d28a
from collections.abc import *
x = {1:1}
match x:
case Mapping():
print("Mapping")
case Sequence():
print("Sequence")
case Callable(): # ✘ error: Expected type in class pattern [misc]
print("Callable")
Expected Behavior
Given that collection.abc
classes are isinstance
-checkable, and it works with the others it should work here as well.
Your Environment
Tested with 0.981, 0.982 and master branch
https://mypy-play.net/?mypy=master&python=3.10&gist=29d49c837fadc7e404ea295c82d0d28a