Skip to content

bpo-29879: Add versionadded where missing in typing.rst #784

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

Closed
wants to merge 1 commit into from
Closed
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
14 changes: 14 additions & 0 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,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 @@ -488,6 +490,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 All @@ -500,6 +504,8 @@ The module defines the following classes, functions and decorators:

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

.. versionadded:: 3.5.2
Copy link
Contributor

@DimitrisJim DimitrisJim Mar 23, 2017

Choose a reason for hiding this comment

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

Insert one more space here in order for it to align with the text. Apart from this, LGTM.

Copy link
Author

Choose a reason for hiding this comment

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

In facts, there are 3 and 4 spaces indentation in this file. What standard is expected ? I could make all the file standard

Copy link
Contributor

@DimitrisJim DimitrisJim Mar 23, 2017

Choose a reason for hiding this comment

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

According to the devguide, it is 3, but don't worry about that too much (i,e don't go changing all the file now). You mainly need to align the ..versionadded with the preceding text so they are formatted as part of the same block.

Copy link
Member

Choose a reason for hiding this comment

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

@DimitrisJim is right: please don't go through and do a mass update of indentation. If you're fixing it for the docs around where you added versionadded then that's fine, but otherwise just leave it be.

Copy link
Member

Choose a reason for hiding this comment

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

@cblegare Are you sure that Reversible is new in 3.5.2? I am almost sure it was always there. (It was slightly changed however around a year ago.)

Copy link
Contributor

Choose a reason for hiding this comment

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

@ilevkivskyi I mentioned Reversible in the tracker due to it's listing in what's new for Python 3.5.2. Here's the change you're talking about too. I guess that either the version needs to get dropped for Reversible or the What's new entry changed, not sure about it though :-)

Copy link
Member

Choose a reason for hiding this comment

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

Since Reversible was in 3.5.0, the versionadded is unnecessary and Misc/NEWS should get fixed.


.. class:: SupportsInt

An ABC with one abstract method ``__int__``.
Expand Down Expand Up @@ -660,6 +666,8 @@ The module defines the following classes, functions and decorators:

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

.. versionadded:: 3.5.2

.. class:: Generator(Iterator[T_co], Generic[T_co, T_contra, V_co])

A generator can be annotated by the generic type
Expand Down Expand Up @@ -736,6 +744,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 @@ -805,6 +815,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 @@ -1007,3 +1019,5 @@ The module defines the following classes, functions and decorators:

def fun():
local_var: expensive_mod.some_type = other_fun()

.. versionadded:: 3.5.2