Closed
Description
Small reproducer:
from dataclasses import dataclass
from typing_extensions import Protocol, runtime_checkable
@runtime_checkable # removing this decorator fixes the bug.
class HasConfig(Protocol):
pass
@runtime_checkable
class Action(HasConfig, Protocol):
pass
@dataclass
class Delete:
pass
delete = 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.
Metadata
Metadata
Assignees
Labels
No labels