bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644)

(cherry picked from commit 8252c52e57)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2019-10-08 07:14:57 -07:00 committed by GitHub
parent 10b475a151
commit 7162440a72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -1513,6 +1513,7 @@ Type.__doc__ = \
@runtime_checkable @runtime_checkable
class SupportsInt(Protocol): class SupportsInt(Protocol):
"""An ABC with one abstract method __int__."""
__slots__ = () __slots__ = ()
@abstractmethod @abstractmethod
@ -1522,6 +1523,7 @@ class SupportsInt(Protocol):
@runtime_checkable @runtime_checkable
class SupportsFloat(Protocol): class SupportsFloat(Protocol):
"""An ABC with one abstract method __float__."""
__slots__ = () __slots__ = ()
@abstractmethod @abstractmethod
@ -1531,6 +1533,7 @@ class SupportsFloat(Protocol):
@runtime_checkable @runtime_checkable
class SupportsComplex(Protocol): class SupportsComplex(Protocol):
"""An ABC with one abstract method __complex__."""
__slots__ = () __slots__ = ()
@abstractmethod @abstractmethod
@ -1540,6 +1543,7 @@ class SupportsComplex(Protocol):
@runtime_checkable @runtime_checkable
class SupportsBytes(Protocol): class SupportsBytes(Protocol):
"""An ABC with one abstract method __bytes__."""
__slots__ = () __slots__ = ()
@abstractmethod @abstractmethod
@ -1549,6 +1553,7 @@ class SupportsBytes(Protocol):
@runtime_checkable @runtime_checkable
class SupportsIndex(Protocol): class SupportsIndex(Protocol):
"""An ABC with one abstract method __index__."""
__slots__ = () __slots__ = ()
@abstractmethod @abstractmethod
@ -1558,6 +1563,7 @@ class SupportsIndex(Protocol):
@runtime_checkable @runtime_checkable
class SupportsAbs(Protocol[T_co]): class SupportsAbs(Protocol[T_co]):
"""An ABC with one abstract method __abs__ that is covariant in its return type."""
__slots__ = () __slots__ = ()
@abstractmethod @abstractmethod
@ -1567,6 +1573,7 @@ class SupportsAbs(Protocol[T_co]):
@runtime_checkable @runtime_checkable
class SupportsRound(Protocol[T_co]): class SupportsRound(Protocol[T_co]):
"""An ABC with one abstract method __round__ that is covariant in its return type."""
__slots__ = () __slots__ = ()
@abstractmethod @abstractmethod