[Python-checkins] [3.7] bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644). (GH-16673)

Serhiy Storchaka webhook-mailer at python.org
Wed Oct 9 05:57:19 EDT 2019


https://github.com/python/cpython/commit/0b354fc2bfe1a4624551907df396ed36ea8bf4ca
commit: 0b354fc2bfe1a4624551907df396ed36ea8bf4ca
branch: 3.7
author: Serhiy Storchaka <storchaka at gmail.com>
committer: GitHub <noreply at github.com>
date: 2019-10-09T12:57:14+03:00
summary:

[3.7] bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644). (GH-16673)

(cherry picked from commit 8252c52e57283515ace5d4251584255dc5c60eb5)

files:
M Lib/typing.py

diff --git a/Lib/typing.py b/Lib/typing.py
index dea7babaf792f..ea8dea54a5a3d 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -1277,6 +1277,7 @@ def new_user(user_class: Type[U]) -> U:
 
 
 class SupportsInt(_Protocol):
+    """An ABC with one abstract method __int__."""
     __slots__ = ()
 
     @abstractmethod
@@ -1285,6 +1286,7 @@ def __int__(self) -> int:
 
 
 class SupportsFloat(_Protocol):
+    """An ABC with one abstract method __float__."""
     __slots__ = ()
 
     @abstractmethod
@@ -1293,6 +1295,7 @@ def __float__(self) -> float:
 
 
 class SupportsComplex(_Protocol):
+    """An ABC with one abstract method __complex__."""
     __slots__ = ()
 
     @abstractmethod
@@ -1301,6 +1304,7 @@ def __complex__(self) -> complex:
 
 
 class SupportsBytes(_Protocol):
+    """An ABC with one abstract method __bytes__."""
     __slots__ = ()
 
     @abstractmethod
@@ -1309,6 +1313,7 @@ def __bytes__(self) -> bytes:
 
 
 class SupportsAbs(_Protocol[T_co]):
+    """An ABC with one abstract method __abs__ that is covariant in its return type."""
     __slots__ = ()
 
     @abstractmethod
@@ -1317,6 +1322,7 @@ def __abs__(self) -> T_co:
 
 
 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