Skip to content

Commit

Permalink
Fix compat_map
Browse files Browse the repository at this point in the history
force-test
  • Loading branch information
Taapat committed May 7, 2023
1 parent 63ef90c commit 28b69e0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from collections import ChainMap as compat_map
else:
from collections import MutableMapping
from itertools import chain

class compat_map(MutableMapping):
maps = [{}]
Expand Down Expand Up @@ -68,11 +69,16 @@ def __delitem__(self, k):
self.__delitem(k)

def __iter__(self):
return itertools.chain(*reversed(self.maps))
return chain(*reversed(self.maps))

def __len__(self):
return len(iter(self))

def new_child(self, m=None, **kwargs):
m = m or {}
m.update(kwargs)
return compat_map(m, *self.maps)


SUBURI = '&suburi='

Expand Down

0 comments on commit 28b69e0

Please sign in to comment.