Skip to content

Commit f8ff18d

Browse files
committed
Loosen type requirements for dig in py_common utils
1 parent db26238 commit f8ff18d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scrapers/py_common/util.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
from argparse import ArgumentParser
22
from functools import reduce
3-
from typing import Any, Callable, TypeVar
3+
from typing import Any, Callable, Iterable, Mapping, TypeVar
44
from urllib.error import URLError
55
from urllib.request import Request, urlopen
66
import json
77
import sys
88

99

10-
def dig(c: dict | list, *keys: str | int | tuple[str | int, ...], default=None) -> Any:
10+
def dig(
11+
c: Mapping | Iterable, *keys: str | int | tuple[str | int, ...], default=None
12+
) -> Any:
1113
"""
1214
Helper function to get a value from a nested dict or list
1315

0 commit comments

Comments
 (0)