[Python-checkins] bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644)
Serhiy Storchaka
webhook-mailer at python.org
Tue Oct 8 09:30:20 EDT 2019
https://github.com/python/cpython/commit/8252c52e57283515ace5d4251584255dc5c60eb5
commit: 8252c52e57283515ace5d4251584255dc5c60eb5
branch: master
author: Serhiy Storchaka <storchaka at gmail.com>
committer: GitHub <noreply at github.com>
date: 2019年10月08日T16:30:17+03:00
summary:
bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644)
files:
M Lib/typing.py
diff --git a/Lib/typing.py b/Lib/typing.py
index 0e842ff9f2048..27be37a369a92 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -1513,6 +1513,7 @@ def new_user(user_class: Type[U]) -> U:
@runtime_checkable
class SupportsInt(Protocol):
+ """An ABC with one abstract method __int__."""
__slots__ = ()
@abstractmethod
@@ -1522,6 +1523,7 @@ def __int__(self) -> int:
@runtime_checkable
class SupportsFloat(Protocol):
+ """An ABC with one abstract method __float__."""
__slots__ = ()
@abstractmethod
@@ -1531,6 +1533,7 @@ def __float__(self) -> float:
@runtime_checkable
class SupportsComplex(Protocol):
+ """An ABC with one abstract method __complex__."""
__slots__ = ()
@abstractmethod
@@ -1540,6 +1543,7 @@ def __complex__(self) -> complex:
@runtime_checkable
class SupportsBytes(Protocol):
+ """An ABC with one abstract method __bytes__."""
__slots__ = ()
@abstractmethod
@@ -1549,6 +1553,7 @@ def __bytes__(self) -> bytes:
@runtime_checkable
class SupportsIndex(Protocol):
+ """An ABC with one abstract method __index__."""
__slots__ = ()
@abstractmethod
@@ -1558,6 +1563,7 @@ def __index__(self) -> int:
@runtime_checkable
class SupportsAbs(Protocol[T_co]):
+ """An ABC with one abstract method __abs__ that is covariant in its return type."""
__slots__ = ()
@abstractmethod
@@ -1567,6 +1573,7 @@ def __abs__(self) -> T_co:
@runtime_checkable
class SupportsRound(Protocol[T_co]):
+ """An ABC with one abstract method __round__ that is covariant in its return type."""
__slots__ = ()
@abstractmethod
More information about the Python-checkins
mailing list