File tree 2 files changed +9
-6
lines changed
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 14
14
import contextlib
15
15
import collections
16
16
17
- from ._collections import freezable_defaultdict
17
+ from ._collections import FreezableDefaultDict
18
18
from ._compat import (
19
19
NullFinder ,
20
20
Protocol ,
@@ -659,8 +659,8 @@ class Lookup:
659
659
def __init__ (self , path : FastPath ):
660
660
base = os .path .basename (path .root ).lower ()
661
661
base_is_egg = base .endswith (".egg" )
662
- self .infos = freezable_defaultdict (list )
663
- self .eggs = freezable_defaultdict (list )
662
+ self .infos = FreezableDefaultDict (list )
663
+ self .eggs = FreezableDefaultDict (list )
664
664
665
665
for child in path .children ():
666
666
low = child .lower ()
Original file line number Diff line number Diff line change 1
1
import collections
2
2
3
3
4
- class freezable_defaultdict (collections .defaultdict ):
4
+ # from jaraco.collections 3.3
5
+ class FreezableDefaultDict (collections .defaultdict ):
5
6
"""
6
- Mix-in to freeze a defaultdict.
7
+ Often it is desirable to prevent the mutation of
8
+ a default dict after its initial construction, such
9
+ as to prevent mutation during iteration.
7
10
8
- >>> dd = freezable_defaultdict (list)
11
+ >>> dd = FreezableDefaultDict (list)
9
12
>>> dd[0].append('1')
10
13
>>> dd.freeze()
11
14
>>> dd[1]
You can’t perform that action at this time.
0 commit comments