Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 18 additions & 4 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ The module defines the following classes, functions and decorators:

A generic version of :class:`collections.abc.Collection`

.. versionadded:: 3.6
.. versionadded:: 3.6.0

.. class:: AbstractSet(Sized, Collection[T_co])

Expand Down Expand Up @@ -599,6 +599,7 @@ The module defines the following classes, functions and decorators:

A generic version of :class:`collections.deque`.

.. versionadded:: 3.5.4
.. versionadded:: 3.6.1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there 2 "versionadded" here ? was this added both ein 3.5.4 and 3.6.1 ? Meaning it's not in 3.6.0 ?
If that's the case that might look like a typo in the docs from a casual reader, and might need a clarification paragraph.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's correct! it is pretty weird!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the story with versions is related to the fact that typing module used to be provisional, so features were added at random time, even between minor releases.


.. class:: List(list, MutableSequence[T])
Expand Down Expand Up @@ -648,6 +649,8 @@ The module defines the following classes, functions and decorators:

A generic version of :class:`collections.abc.Awaitable`.

.. versionadded:: 3.5.2

.. class:: Coroutine(Awaitable[V_co], Generic[T_co T_contra, V_co])

A generic version of :class:`collections.abc.Coroutine`.
Expand All @@ -661,25 +664,33 @@ The module defines the following classes, functions and decorators:
async def bar() -> None:
x = await c # type: int

.. versionadded:: 3.5.3

.. class:: AsyncIterable(Generic[T_co])

A generic version of :class:`collections.abc.AsyncIterable`.

.. versionadded:: 3.5.2

.. class:: AsyncIterator(AsyncIterable[T_co])

A generic version of :class:`collections.abc.AsyncIterator`.

.. versionadded:: 3.5.2

.. class:: ContextManager(Generic[T_co])

A generic version of :class:`contextlib.AbstractContextManager`.

.. versionadded:: 3.6
.. versionadded:: 3.5.4
.. versionadded:: 3.6.0

.. class:: AsyncContextManager(Generic[T_co])

A generic version of :class:`contextlib.AbstractAsyncContextManager`.

.. versionadded:: 3.6
.. versionadded:: 3.5.4
.. versionadded:: 3.6.2

.. class:: Dict(dict, MutableMapping[KT, VT])

Expand Down Expand Up @@ -708,12 +719,14 @@ The module defines the following classes, functions and decorators:

A generic version of :class:`collections.Counter`.

.. versionadded:: 3.5.4
.. versionadded:: 3.6.1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same on all of these; that feel super weird;


.. class:: ChainMap(collections.ChainMap, MutableMapping[KT, VT])

A generic version of :class:`collections.ChainMap`.

.. versionadded:: 3.5.4
.. versionadded:: 3.6.1

.. class:: Generator(Iterator[T_co], Generic[T_co, T_contra, V_co])
Expand Down Expand Up @@ -778,7 +791,7 @@ The module defines the following classes, functions and decorators:
yield start
start = await increment(start)

.. versionadded:: 3.5.4
.. versionadded:: 3.6.1

.. class:: Text

Expand Down Expand Up @@ -987,6 +1000,7 @@ The module defines the following classes, functions and decorators:
raise RuntimeError('no way')

.. versionadded:: 3.5.4
.. versionadded:: 3.6.2

.. data:: Union

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve version added references in ``typing`` module - by Anthony Sottile.