-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongtopic-pep-695Issues related to PEP 695 syntaxIssues related to PEP 695 syntaxtopic-protocolstopic-recursive-types
Description
The following code:
class ComparableNumber[T: ComparableNumber](Protocol):
def __lt__(self, other: T, /) -> bool: ...
def __gt__(self, other: T, /) -> bool: ...
def __int__(self) -> int: ...Fails with:
_typing.py:15: error: Cannot resolve name "ComparableNumber" (possible cyclic definition) [misc]
Pyright seems to accept it with no issue and python itself doesn't complain or raise any exception when this definition is loaded at runtime.
This is with the current head version from github with default configuration, no command line switches and with
# mypy: enable-incomplete-feature=NewGenericSyntax
being used in the file where this is defined.
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-pep-695Issues related to PEP 695 syntaxIssues related to PEP 695 syntaxtopic-protocolstopic-recursive-types