Import MutableMapping and MutableSet from collections.abc.

Aliases in collections itself are removed in 3.8.
This commit is contained in:
Valentin Lorentz 2020-01-09 01:11:02 +01:00
parent 94ca4cc810
commit 0fccea30ce
3 changed files with 7 additions and 7 deletions

View File

@ -36,7 +36,7 @@ import codecs
import fnmatch
import os.path
import threading
import collections
import collections.abc
from .. import callbacks, conf, dbi, ircdb, ircutils, log, utils, world
from ..commands import *
@ -174,7 +174,7 @@ class DbiChannelDB(object):
return _getDbAndDispatcher
class ChannelUserDictionary(collections.MutableMapping):
class ChannelUserDictionary(collections.abc.MutableMapping):
IdDict = dict
def __init__(self):
self.channels = ircutils.IrcDict()

View File

@ -37,7 +37,7 @@ import textwrap
import warnings
import functools
import traceback
import collections
import collections.abc
from . import crypt
@ -254,7 +254,7 @@ class IterableMap(object):
__nonzero__ = __bool__
class InsensitivePreservingDict(collections.MutableMapping):
class InsensitivePreservingDict(collections.abc.MutableMapping):
def key(self, s):
"""Override this if you wish."""
if s is not None:

View File

@ -32,7 +32,7 @@ Data structures for Python.
"""
import time
import collections
import collections.abc
class RingBuffer(object):
@ -427,7 +427,7 @@ class MultiSet(object):
return elt in self.d
class CacheDict(collections.MutableMapping):
class CacheDict(collections.abc.MutableMapping):
__slots__ = ('d', 'max')
def __init__(self, max, **kwargs):
self.d = dict(**kwargs)
@ -456,7 +456,7 @@ class CacheDict(collections.MutableMapping):
def __len__(self):
return len(self.d)
class TruncatableSet(collections.MutableSet):
class TruncatableSet(collections.abc.MutableSet):
"""A set that keeps track of the order of inserted elements so
the oldest can be removed."""
__slots__ = ('_ordered_items', '_items')