class OnlySelf: def __init__(self): pass def f(obj): match obj: case OnlySelf(1): pass