From 617954304cdefcada05d88b41d8351a84295e605 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sun, 28 Oct 2018 12:59:59 +0100 Subject: [PATCH 1/3] bpo-35089: Don't mention typing.io and typing.re --- Doc/library/typing.rst | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 06c1b8526c406c..755859f9f59a25 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -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 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. From cfeda96cd94e0330bf61f63ef5f663b350aafa34 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sun, 28 Oct 2018 16:51:48 +0100 Subject: [PATCH 2/3] Add a NEWS entry --- .../next/Documentation/2018-10-28-16-51-31.bpo-35089._stCpS.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Documentation/2018-10-28-16-51-31.bpo-35089._stCpS.rst diff --git a/Misc/NEWS.d/next/Documentation/2018-10-28-16-51-31.bpo-35089._stCpS.rst b/Misc/NEWS.d/next/Documentation/2018-10-28-16-51-31.bpo-35089._stCpS.rst new file mode 100644 index 00000000000000..4a469290ad733a --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-10-28-16-51-31.bpo-35089._stCpS.rst @@ -0,0 +1,2 @@ +Remove mention of ``typing.io`` and ``typing.re``. Their types should be +imported from ``typing`` directly. From 2fddd79f8bdb2fed8d344d9b89706db6212cb10b Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sun, 28 Oct 2018 16:54:10 +0100 Subject: [PATCH 3/3] Add 'its' --- Doc/library/typing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 755859f9f59a25..4469e88b22488d 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -783,7 +783,7 @@ The module defines the following classes, functions and decorators: TextIO BinaryIO - Generic type ``IO[AnyStr]`` and subclasses ``TextIO(IO[str])`` + 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`.