Skip to content

Commit 7162440

Browse files
bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644)
(cherry picked from commit 8252c52) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 10b475a commit 7162440

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/typing.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,7 @@ def new_user(user_class: Type[U]) -> U:
15131513

15141514
@runtime_checkable
15151515
class SupportsInt(Protocol):
1516+
"""An ABC with one abstract method __int__."""
15161517
__slots__ = ()
15171518

15181519
@abstractmethod
@@ -1522,6 +1523,7 @@ def __int__(self) -> int:
15221523

15231524
@runtime_checkable
15241525
class SupportsFloat(Protocol):
1526+
"""An ABC with one abstract method __float__."""
15251527
__slots__ = ()
15261528

15271529
@abstractmethod
@@ -1531,6 +1533,7 @@ def __float__(self) -> float:
15311533

15321534
@runtime_checkable
15331535
class SupportsComplex(Protocol):
1536+
"""An ABC with one abstract method __complex__."""
15341537
__slots__ = ()
15351538

15361539
@abstractmethod
@@ -1540,6 +1543,7 @@ def __complex__(self) -> complex:
15401543

15411544
@runtime_checkable
15421545
class SupportsBytes(Protocol):
1546+
"""An ABC with one abstract method __bytes__."""
15431547
__slots__ = ()
15441548

15451549
@abstractmethod
@@ -1549,6 +1553,7 @@ def __bytes__(self) -> bytes:
15491553

15501554
@runtime_checkable
15511555
class SupportsIndex(Protocol):
1556+
"""An ABC with one abstract method __index__."""
15521557
__slots__ = ()
15531558

15541559
@abstractmethod
@@ -1558,6 +1563,7 @@ def __index__(self) -> int:
15581563

15591564
@runtime_checkable
15601565
class SupportsAbs(Protocol[T_co]):
1566+
"""An ABC with one abstract method __abs__ that is covariant in its return type."""
15611567
__slots__ = ()
15621568

15631569
@abstractmethod
@@ -1567,6 +1573,7 @@ def __abs__(self) -> T_co:
15671573

15681574
@runtime_checkable
15691575
class SupportsRound(Protocol[T_co]):
1576+
"""An ABC with one abstract method __round__ that is covariant in its return type."""
15701577
__slots__ = ()
15711578

15721579
@abstractmethod

0 commit comments

Comments
 (0)