File tree Expand file tree Collapse file tree 4 files changed +10
-281
lines changed
source_py3/python_toolbox/nifty_collections Expand file tree Collapse file tree 4 files changed +10
-281
lines changed Original file line number Diff line number Diff line change 33
44'''Defines various data types, similarly to the stdlib's `collections`.'''
55
6+ import collections
7+
8+
69from .ordered_dict import OrderedDict
710from .ordered_set import OrderedSet
811from .weak_key_default_dict import WeakKeyDefaultDict
912from .weak_key_identity_dict import WeakKeyIdentityDict
10- from .counter import Counter
1113from .lazy_tuple import LazyTuple
1214
1315from .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
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 88'''
99# todo: revamp
1010
11- import UserDict
1211from weakref import ref
1312import 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
Original file line number Diff line number Diff line change 99# todo: revamp
1010
1111import 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
You can’t perform that action at this time.
0 commit comments