class Empty: pass def f(obj): match obj: case Empty(1): pass