@@ 68,13 68,13 @@ class RequestBindAdapter(BindAdapter):
unnumbered_list_separator = "[]"
def __init__(self):
- unnumbered_list_pattern = "{0}(?P<U>)".format(
+ unnumbered_list_pattern = r"{0}(?P<U>)".format(
re.escape(self.unnumbered_list_separator)
)
- numbered_list_pattern = "{0}(?P<N>\d+)".format(
+ numbered_list_pattern = r"{0}(?P<N>\d+)".format(
re.escape(self.list_separator)
)
- dict_pattern = "{0}(?P<D>([^\.#\[]+))".format(
+ dict_pattern = r"{0}(?P<D>([^\.#\[]+))".format(
re.escape(self.dict_separator)
)
self._finder = re.compile(
@@ 109,31 109,31 @@ class RequestBindAdapter(BindAdapter):
# Numbered list
elif match["N"] is not None:
- l = setval({})
- if l and identity not in list_surrogates:
+ items = setval({})
+ if items and identity not in list_surrogates:
self.warn_mixed_key(path)
continue
list_surrogates[(id(curdata), curkey)] = (
curdata,
curkey,
- l,
+ items,
)
- curdata = l
+ curdata = items
curkey = match["N"]
setval = partial(curdata.setdefault, curkey)
# Unnumbered list
elif match["U"] is not None:
- l = setval({})
- if l and identity not in list_surrogates:
+ items = setval({})
+ if items and identity not in list_surrogates:
self.warn_mixed_key(path)
continue
list_surrogates[(id(curdata), curkey)] = (
curdata,
curkey,
- l,
+ items,
)
- curdata = l
+ curdata = items
curkey = len(curdata)
setval = partial(curdata.setdefault, curkey)