49 lines
1.4 KiB
Diff
49 lines
1.4 KiB
Diff
From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
|
|
Date: Sun, 20 Feb 2022 20:12:28 +0100
|
|
Subject: Import abstract base classes from collections.abc
|
|
|
|
---
|
|
twodict.py | 8 ++++----
|
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/twodict.py b/twodict.py
|
|
index 824e539..efbd342 100644
|
|
--- a/twodict.py
|
|
+++ b/twodict.py
|
|
@@ -6,7 +6,7 @@ Attributes:
|
|
"""
|
|
|
|
import sys
|
|
-import collections
|
|
+import collections.abc
|
|
|
|
|
|
__all__ = ["TwoWayOrderedDict"]
|
|
@@ -22,7 +22,7 @@ _DEFAULT_OBJECT = object()
|
|
########## Custom views to mimic Python3 view objects ##########
|
|
# See: https://docs.python.org/3/library/stdtypes.html#dict-views
|
|
|
|
-class DictKeysView(collections.KeysView):
|
|
+class DictKeysView(collections.abc.KeysView):
|
|
|
|
def __init__(self, data):
|
|
super(DictKeysView, self).__init__(data)
|
|
@@ -35,7 +35,7 @@ class DictKeysView(collections.KeysView):
|
|
return key in [key for key in self.__data]
|
|
|
|
|
|
-class DictValuesView(collections.ValuesView):
|
|
+class DictValuesView(collections.abc.ValuesView):
|
|
|
|
def __init__(self, data):
|
|
super(DictValuesView, self).__init__(data)
|
|
@@ -48,7 +48,7 @@ class DictValuesView(collections.ValuesView):
|
|
return value in [self.__data[key] for key in self.__data]
|
|
|
|
|
|
-class DictItemsView(collections.ItemsView):
|
|
+class DictItemsView(collections.abc.ItemsView):
|
|
|
|
def __init__(self, data):
|
|
super(DictItemsView, self).__init__(data)
|