]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.7] bpo-39493: Fix definition of IO.closed in typing.py (GH-18273)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 30 Jan 2020 06:00:12 +0000 (22:00 -0800)
committerGitHub <noreply@github.com>
Thu, 30 Jan 2020 06:00:12 +0000 (22:00 -0800)
* bpo-39493: Fix definition of IO.closed in typing.py (GH-18265)
(cherry picked from commit 2e6569b6692298fcc9aae0df3eb3181adb2a5099)

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
* Use @absractproperty

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
Co-authored-by: Guido van Rossum <guido@python.org>
Lib/typing.py
Misc/NEWS.d/next/Library/2020-01-30-01-13-19.bpo-39493.CbFRi7.rst [new file with mode: 0644]

index 607eb1f8fc31a8e790fc19b28b0d850339c2c91d..3b2e3720fff574c6d7446bd768a3fbadcbdbf680 100644 (file)
@@ -1509,7 +1509,7 @@ class IO(Generic[AnyStr]):
     def close(self) -> None:
         pass
 
-    @abstractmethod
+    @abstractproperty
     def closed(self) -> bool:
         pass
 
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 (file)
index 0000000..b676629
--- /dev/null
@@ -0,0 +1 @@
+Mark ``typing.IO.closed`` as a property
\ No newline at end of file