summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMax Zhenzhera <59729293+maxzhenzhera@users.noreply.github.com>2022-07-12 17:45:52 (GMT)
committerGitHub <noreply@github.com>2022-07-12 17:45:52 (GMT)
commit90a6e56e5663233fe986331ef3f10422fe57dcbc (patch)
treed2a5e2148835682fdfdc67df3d17e5f7e5eeaf00 /Doc
parent0c66074e9f8c9728e1d920910d35da0c62f30403 (diff)
downloadcpython-90a6e56e5663233fe986331ef3f10422fe57dcbc.zip
cpython-90a6e56e5663233fe986331ef3f10422fe57dcbc.tar.gz
cpython-90a6e56e5663233fe986331ef3f10422fe57dcbc.tar.bz2
docs: typing.Self, fix typo (GH-94771)
* fix typo - double spelled word 'use' * change methods names to the infinitive form
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/typing.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst
index 3980e45..4d422f5 100644
--- a/Doc/library/typing.rst
+++ b/Doc/library/typing.rst
@@ -683,7 +683,7 @@ These can be used as types in annotations and do not support ``[]``.
from typing import Self
class Foo:
- def returns_self(self) -> Self:
+ def return_self(self) -> Self:
...
return self
@@ -696,7 +696,7 @@ These can be used as types in annotations and do not support ``[]``.
Self = TypeVar("Self", bound="Foo")
class Foo:
- def returns_self(self: Self) -> Self:
+ def return_self(self: Self) -> Self:
...
return self
@@ -707,7 +707,7 @@ These can be used as types in annotations and do not support ``[]``.
...
return self
- You should use use :data:`Self` as calls to ``SubclassOfFoo.returns_self`` would have
+ You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would have
``Foo`` as the return type and not ``SubclassOfFoo``.
Other common use cases include: