Skip to content

Commit de2f375

Browse files
authored
[docs] Replace List with built‑in list (PEP 585) (#20000)
Updated the docs to replace typing.List with the built‑in generic list (PEP 585). The example would not work if someone copied and pasted it.
1 parent fe31334 commit de2f375

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/source/common_issues.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ This example demonstrates both safe and unsafe overrides:
731731
732732
class NarrowerReturn(A):
733733
# A more specific return type is fine
734-
def test(self, t: Sequence[int]) -> List[str]: # OK
734+
def test(self, t: Sequence[int]) -> list[str]: # OK
735735
...
736736
737737
class GeneralizedReturn(A):
@@ -746,7 +746,7 @@ not necessary:
746746
.. code-block:: python
747747
748748
class NarrowerArgument(A):
749-
def test(self, t: List[int]) -> Sequence[str]: # type: ignore[override]
749+
def test(self, t: list[int]) -> Sequence[str]: # type: ignore[override]
750750
...
751751
752752
.. _unreachable:

0 commit comments

Comments
 (0)