Skip to content

Commit c8a8d6b

Browse files
srittauilevkivskyi
authored andcommitted
bpo-35089: Don't mention typing.io and typing.re (GH-10173)
https://bugs.python.org/issue35089
1 parent 163eca3 commit c8a8d6b

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

Doc/library/typing.rst

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -779,32 +779,25 @@ The module defines the following classes, functions and decorators:
779779

780780
.. versionadded:: 3.5.2
781781

782-
.. class:: io
782+
.. class:: IO
783+
TextIO
784+
BinaryIO
783785

784-
Wrapper namespace for I/O stream types.
785-
786-
This defines the generic type ``IO[AnyStr]`` and subclasses ``TextIO``
787-
and ``BinaryIO``, deriving from ``IO[str]`` and ``IO[bytes]``,
788-
respectively. These represent the types of I/O streams such as returned by
786+
Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])``
787+
and ``BinaryIO(IO[bytes])``
788+
represent the types of I/O streams such as returned by
789789
:func:`open`.
790790

791-
These types are also accessible directly as ``typing.IO``,
792-
``typing.TextIO``, and ``typing.BinaryIO``.
793-
794-
.. class:: re
791+
.. class:: Pattern
792+
Match
795793

796-
Wrapper namespace for regular expression matching types.
797-
798-
This defines the type aliases ``Pattern`` and ``Match`` which
794+
These type aliases
799795
correspond to the return types from :func:`re.compile` and
800796
:func:`re.match`. These types (and the corresponding functions)
801797
are generic in ``AnyStr`` and can be made specific by writing
802798
``Pattern[str]``, ``Pattern[bytes]``, ``Match[str]``, or
803799
``Match[bytes]``.
804800

805-
These types are also accessible directly as ``typing.Pattern``
806-
and ``typing.Match``.
807-
808801
.. class:: NamedTuple
809802

810803
Typed version of namedtuple.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Remove mention of ``typing.io`` and ``typing.re``. Their types should be
2+
imported from ``typing`` directly.

0 commit comments

Comments
 (0)