Skip to content

[3.7] bpo-35089: Don't mention typing.io and typing.re (GH-10173) #10177

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
Oct 28, 2018
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
25 changes: 9 additions & 16 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -779,32 +779,25 @@ The module defines the following classes, functions and decorators:

.. versionadded:: 3.5.2

.. class:: io
.. class:: IO
TextIO
BinaryIO

Wrapper namespace for I/O stream types.

This defines the generic type ``IO[AnyStr]`` and subclasses ``TextIO``
and ``BinaryIO``, deriving from ``IO[str]`` and ``IO[bytes]``,
respectively. These represent the types of I/O streams such as returned by
Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])``
and ``BinaryIO(IO[bytes])``
represent the types of I/O streams such as returned by
:func:`open`.

These types are also accessible directly as ``typing.IO``,
``typing.TextIO``, and ``typing.BinaryIO``.

.. class:: re
.. class:: Pattern
Match

Wrapper namespace for regular expression matching types.

This defines the type aliases ``Pattern`` and ``Match`` which
These type aliases
correspond to the return types from :func:`re.compile` and
:func:`re.match`. These types (and the corresponding functions)
are generic in ``AnyStr`` and can be made specific by writing
``Pattern[str]``, ``Pattern[bytes]``, ``Match[str]``, or
``Match[bytes]``.

These types are also accessible directly as ``typing.Pattern``
and ``typing.Match``.

.. class:: NamedTuple

Typed version of namedtuple.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove mention of ``typing.io`` and ``typing.re``. Their types should be
imported from ``typing`` directly.