Small reproducer:
fromdataclassesimportdataclassfromtyping_extensionsimportProtocol, runtime_checkable@runtime_checkable# removing this decorator fixes the bug.classHasConfig(Protocol):
pass@runtime_checkableclassAction(HasConfig, Protocol):
pass@dataclassclassDelete:
passdelete=Delete()
print(isinstance(delete, Action))
This prints False in 3.12.2, True in 3.12.1. Changing the import to from typing import Protocol, runtime_checkable also makes this bug disappear.
Small reproducer:
This prints
Falsein 3.12.2,Truein 3.12.1. Changing the import tofrom typing import Protocol, runtime_checkablealso makes this bug disappear.