8000 bpo-35089: Don't mention typing.io and typing.re (GH-10173) · python/cpython@a36f04c · GitHub
[go: up one dir, main page]

Skip to content

Commit a36f04c

Browse files
bpo-35089: Don't mention typing.io and typing.re (GH-10173)
https://bugs.python.org/issue35089 (cherry picked from commit c8a8d6b) Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
1 parent 0e6329d commit a36f04c

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
@@ -780,32 +780,25 @@ The module defines the following classes, functions and decorators:
780780

781781
.. versionadded:: 3.5.2
782782

783-
.. class:: io
783+
.. class:: IO
784+
TextIO
785+
BinaryIO
784786

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

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

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

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

811804
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)
0