Skip to content

Commit 2af0ac0

Browse files
suutariilevkivskyi
authored andcommitted
docs/more_types: Fix typso in advanced self-types (python#8006)
* docs/more_types: Fix typo in advanced self-types The type of self should be `Tag[str]` here. * docs/more_types: Fix a typo in Tag.export example The `export` methods seems to actually return an `str` instead of `T` even when a converter is given.
1 parent 20b60b5 commit 2af0ac0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/source/more_types.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ for certain values of type arguments:
582582
583583
class Tag(Generic[T]):
584584
item: T
585-
def uppercase_item(self: C[str]) -> str:
585+
def uppercase_item(self: Tag[str]) -> str:
586586
return self.item.upper()
587587
588588
def label(ti: Tag[int], ts: Tag[str]) -> None:
@@ -621,7 +621,7 @@ some tricky methods:
621621
@overload
622622
def export(self: Tag[str]) -> str: ...
623623
@overload
624-
def export(self, converter: Callable[[T], str]) -> T: ...
624+
def export(self, converter: Callable[[T], str]) -> str: ...
625625
626626
def export(self, converter=None):
627627
if isinstance(self.item, str):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy