Skip to content

[skip news] bpo-29879: Add versionadded where missing in typing.rst (and fix old Misc/NEWS) #4573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2017
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
12 changes: 12 additions & 0 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ See :pep:`484` for more details.
``Derived`` is expected. This is useful when you want to prevent logic
errors with minimal runtime cost.

.. versionadded:: 3.5.2

Callable
--------

Expand Down Expand Up @@ -494,6 +496,8 @@ The module defines the following classes, functions and decorators:
``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent
to ``type``, which is the root of Python's metaclass hierarchy.

.. versionadded:: 3.5.2

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

A generic version of :class:`collections.abc.Iterable`.
Expand Down Expand Up @@ -674,6 +678,8 @@ The module defines the following classes, functions and decorators:

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

.. versionadded:: 3.5.2

.. class:: Counter(collections.Counter, Dict[T, int])

A generic version of :class:`collections.Counter`.
Expand Down Expand Up @@ -762,6 +768,8 @@ The module defines the following classes, functions and decorators:
def add_unicode_checkmark(text: Text) -> Text:
return text + u' \u2713'

.. versionadded:: 3.5.2

.. class:: io

Wrapper namespace for I/O stream types.
Expand Down Expand Up @@ -847,6 +855,8 @@ The module defines the following classes, functions and decorators:
UserId = NewType('UserId', int)
first_user = UserId(1)

.. versionadded:: 3.5.2

.. function:: cast(typ, val)

Cast a value to a type.
Expand Down Expand Up @@ -1054,3 +1064,5 @@ The module defines the following classes, functions and decorators:
"forward reference", to hide the ``expensive_mod`` reference from the
interpreter runtime. Type annotations for local variables are not
evaluated, so the second annotation does not need to be enclosed in quotes.

.. versionadded:: 3.5.2
2 changes: 1 addition & 1 deletion Misc/NEWS.d/3.5.2rc1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ patch by ingrid.
.. section: Library

A new version of typing.py provides several new classes and features:
@overload outside stubs, Reversible, DefaultDict, Text, ContextManager,
@overload outside stubs, DefaultDict, Text, ContextManager,
Type[], NewType(), TYPE_CHECKING, and numerous bug fixes (note that some of
the new features are not yet implemented in mypy or other static analyzers).
Also classes for PEP 492 (Awaitable, AsyncIterable, AsyncIterator) have been
Expand Down