[Python-checkins] [3.7] bpo-39493: Fix definition of IO.closed in typing.py (GH-18273)

Miss Islington (bot) webhook-mailer at python.org
Thu Jan 30 01:00:16 EST 2020

commit: 194c7aeb6f3d6c2b0015457d22b38253652f4f38
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-01-29T22:00:12-08:00

[3.7] bpo-39493: Fix definition of IO.closed in typing.py (GH-18273)

* bpo-39493: Fix definition of IO.closed in typing.py (GH-18265)
(cherry picked from commit 2e6569b6692298fcc9aae0df3eb3181adb2a5099)

Co-authored-by: Shantanu <hauntsaninja at users.noreply.github.com>

* Use @absractproperty

Co-authored-by: Shantanu <hauntsaninja at users.noreply.github.com>
Co-authored-by: Guido van Rossum <guido at python.org>

A Misc/NEWS.d/next/Library/2020-01-30-01-13-19.bpo-39493.CbFRi7.rst
M Lib/typing.py

diff --git a/Lib/typing.py b/Lib/typing.py
index 607eb1f8fc31a..3b2e3720fff57 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -1509,7 +1509,7 @@ def name(self) -> str:
     def close(self) -> None:
-    @abstractmethod
+    @abstractproperty
     def closed(self) -> bool:
diff --git a/Misc/NEWS.d/next/Library/2020-01-30-01-13-19.bpo-39493.CbFRi7.rst b/Misc/NEWS.d/next/Library/2020-01-30-01-13-19.bpo-39493.CbFRi7.rst
new file mode 100644
index 0000000000000..b676629a4414a
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2020-01-30-01-13-19.bpo-39493.CbFRi7.rst
@@ -0,0 +1 @@
+Mark ``typing.IO.closed`` as a property
\ No newline at end of file

More information about the Python-checkins mailing list