Skip to content

Commit

Permalink
Loosen type requirements for dig in py_common utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Maista6969 committed Jan 13, 2025
1 parent db26238 commit f8ff18d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scrapers/py_common/util.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from argparse import ArgumentParser
from functools import reduce
from typing import Any, Callable, TypeVar
from typing import Any, Callable, Iterable, Mapping, TypeVar
from urllib.error import URLError
from urllib.request import Request, urlopen
import json
import sys


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

0 comments on commit f8ff18d

Please sign in to comment.