From 03becc06e76cef96e4591aef07615291ab170b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ta=C5=9Fkaya?= Date: Wed, 1 May 2019 10:54:52 +0300 Subject: [PATCH 1/2] bpo-36764: Types module now has a ABCData type The _abc_data type used in abstract base classes. It can obtained by creating an ABC then getting its _abc_impl attribute. --- Lib/types.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/types.py b/Lib/types.py index 37ba4bb1f42e5d..735975be7f7db9 100644 --- a/Lib/types.py +++ b/Lib/types.py @@ -50,6 +50,11 @@ def _m(self): pass ModuleType = type(sys) +from abc import ABC +class _D(ABC): + pass +ABCData = type(_D._abc_impl) + try: raise TypeError except TypeError: From b1a24499ae7134bf74fb8d4208dac6038a37ec19 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" Date: Wed, 1 May 2019 08:04:48 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NEWS.d/next/Library/2019-05-01-08-04-47.bpo-36764.Im4BRF.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2019-05-01-08-04-47.bpo-36764.Im4BRF.rst diff --git a/Misc/NEWS.d/next/Library/2019-05-01-08-04-47.bpo-36764.Im4BRF.rst b/Misc/NEWS.d/next/Library/2019-05-01-08-04-47.bpo-36764.Im4BRF.rst new file mode 100644 index 00000000000000..6ec7297dacfe58 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-05-01-08-04-47.bpo-36764.Im4BRF.rst @@ -0,0 +1 @@ +Add ABCData type to types module. Contributed by Batuhan Taskaya. \ No newline at end of file