8000 [3.7] bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-1… · python/cpython@0b354fc · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b354fc

Browse files
[3.7] bpo-38407: Add docstrings for typing.SupportsXXX classes. (GH-16644). (GH-16673)
(cherry picked from commit 8252c52)
1 parent 87db4d3 commit 0b354fc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/typing.py

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

12781278

12791279
class SupportsInt(_Protocol):
1280+
"""An ABC with one abstract method __int__."""
12801281
__slots__ = ()
12811282

12821283
@abstractmethod
@@ -1285,6 +1286,7 @@ def __int__(self) -> int:
12851286

12861287

12871288
class SupportsFloat(_Protocol):
1289+
"""An ABC with one abstract method __float__."""
12881290
__slots__ = ()
12891291

12901292
@abstractmethod
@@ -1293,6 +1295,7 @@ def __float__(self) -> float:
12931295

12941296

12951297
class SupportsComplex(_Protocol):
1298+
"""An ABC with one abstract method __complex__."""
12961299
__slots__ = ()
12971300

12981301
@abstractmethod
@@ -1301,6 +1304,7 @@ def __complex__(self) -> complex:
13011304

13021305

13031306
class SupportsBytes(_Protocol):
1307+
"""An ABC with one abstract method __bytes__."""
13041308
__slots__ = ()
13051309

13061310
@abstractmethod
@@ -1309,6 +1313,7 @@ def __bytes__(self) -> bytes:
13091313

13101314

13111315
class SupportsAbs(_Protocol[T_co]):
1316+
"""An ABC with one abstract method __abs__ that is covariant in its return type."""
13121317
__slots__ = ()
13131318

13141319
@abstractmethod
@@ -1317,6 +1322,7 @@ def __abs__(self) -> T_co:
13171322

13181323

13191324
class SupportsRound(_Protocol[T_co]):
1325+
"""An ABC with one abstract method __round__ that is covariant in its return type."""
13201326
__slots__ = ()
13211327

13221328
@abstractmethod

0 commit comments

Comments
 (0)
0