🌐 AI搜索 & 代理 主页
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove "This type may be used as follows" notes from List, Dict and M…
…apping
  • Loading branch information
sterliakov committed Sep 1, 2024
commit a65f256a2f8ba8966e89bb791a546526dd2947d0
5 changes: 0 additions & 5 deletions Doc/library/collections.abc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,6 @@ Collections Abstract Base Classes -- Detailed Descriptions

ABCs for read-only and mutable :term:`mappings <mapping>`.

Example use in type annotations::

def get_position_in_index(word_list: Mapping[str, int], word: str) -> int:
return word_list[word]

.. class:: MappingView
ItemsView
KeysView
Expand Down
13 changes: 0 additions & 13 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3402,11 +3402,6 @@ Aliases to built-in types
to use an abstract collection type such as :class:`Mapping`
rather than to use :class:`dict` or :class:`!typing.Dict`.

This type can be used as follows::

def count_words(text: str) -> Dict[str, int]:
...

.. deprecated:: 3.9
:class:`builtins.dict <dict>` now supports subscripting (``[]``).
See :pep:`585` and :ref:`types-genericalias`.
Expand All @@ -3419,14 +3414,6 @@ Aliases to built-in types
to use an abstract collection type such as :class:`Sequence` or
:class:`Iterable` rather than to use :class:`list` or :class:`!typing.List`.

This type may be used as follows::

def vec2[T: (int, float)](x: T, y: T) -> List[T]:
return [x, y]

def keep_positives[T: (int, float)](vector: Sequence[T]) -> List[T]:
return [item for item in vector if item > 0]

.. deprecated:: 3.9
:class:`builtins.list <list>` now supports subscripting (``[]``).
See :pep:`585` and :ref:`types-genericalias`.
Expand Down