Skip to content

Different results in Python 3.12.1 vs Python 3.12.2 #335

Description

@tfeldmann

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions