-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
Right now _ProtocolMeta
is never used:
Line 282 in 739711e
class _ProtocolMeta(ABCMeta): ... |
But, it is a base metaclass for Protocol
type in typing.py
: https://github.com/python/cpython/blame/723ebe76e787cfa6b08cc9587dd679f3234a1025/Lib/typing.py#L1965
It is also used for all Protocol
types (we currently just use ABCMeta
for them`):
Lines 287 to 305 in 739711e
@runtime_checkable | |
class SupportsInt(Protocol, metaclass=ABCMeta): | |
@abstractmethod | |
def __int__(self) -> int: ... | |
@runtime_checkable | |
class SupportsFloat(Protocol, metaclass=ABCMeta): | |
@abstractmethod | |
def __float__(self) -> float: ... | |
@runtime_checkable | |
class SupportsComplex(Protocol, metaclass=ABCMeta): | |
@abstractmethod | |
def __complex__(self) -> complex: ... | |
@runtime_checkable | |
class SupportsBytes(Protocol, metaclass=ABCMeta): | |
@abstractmethod | |
def __bytes__(self) -> bytes: ... |
So, the question is:
- Should we use for
Protocol
class? It is rather complex, because right nowProtocol
is_SpecialForm
- Should we use it for
Protocol
types intyping.pyi
?
Metadata
Metadata
Assignees
Labels
No labels