Skip to content

Commit 983305f

Browse files
committed
-
1 parent 6342893 commit 983305f

File tree

4 files changed

+10
-281
lines changed

4 files changed

+10
-281
lines changed

source_py3/python_toolbox/nifty_collections/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33

44
'''Defines various data types, similarly to the stdlib's `collections`.'''
55

6+
import collections
7+
8+
69
from .ordered_dict import OrderedDict
710
from .ordered_set import OrderedSet
811
from .weak_key_default_dict import WeakKeyDefaultDict
912
from .weak_key_identity_dict import WeakKeyIdentityDict
10-
from .counter import Counter
1113
from .lazy_tuple import LazyTuple
1214

1315
from .emitting_ordered_set import EmittingOrderedSet
14-
from .emitting_weak_key_default_dict import EmittingWeakKeyDefaultDict
16+
from .emitting_weak_key_default_dict import EmittingWeakKeyDefaultDict
17+
18+
Counter = collections.Counter

source_py3/python_toolbox/nifty_collections/counter.py

Lines changed: 0 additions & 275 deletions
This file was deleted.

source_py3/python_toolbox/nifty_collections/weak_key_default_dict.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
'''
99
# todo: revamp
1010

11-
import UserDict
1211
from weakref import ref
1312
import collections
1413

1514

16-
class WeakKeyDefaultDict(UserDict.UserDict, object): #todo: needs testing
15+
#todo: needs testing
16+
class WeakKeyDefaultDict(collections.MutableMapping, object):
1717
'''
1818
A weak key dictionary which can use a default factory.
1919

source_py3/python_toolbox/nifty_collections/weak_key_identity_dict.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# todo: revamp
1010

1111
import weakref
12-
import UserDict
12+
import collections
1313

1414

1515
__all__ = ['WeakKeyIdentityDict']
@@ -27,7 +27,7 @@ def __hash__(self):
2727
return self._hash
2828

2929

30-
class WeakKeyIdentityDict(UserDict.UserDict, object):
30+
class WeakKeyIdentityDict(collections.MutableMapping, object):
3131
"""
3232
A weak key dictionary which cares about the keys' identities.
3333

0 commit comments

Comments
 (0)