diff --git a/pyproject.toml b/pyproject.toml index 75bae71..b1aacfe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "literal-dict" -version = "1.0.1" +version = "1.0.1.1" description = "Use JavaScript-like object definition syntax in Python" authors = [{ name = "Muspi Merol", email = "me@muspimerol.site" }] dependencies = [] diff --git a/src/literal_dict.py b/src/literal_dict.py index 21718e6..359abba 100644 --- a/src/literal_dict.py +++ b/src/literal_dict.py @@ -1,13 +1,13 @@ from inspect import currentframe -from typing import Callable, Generic, Mapping, Sequence, TypeVar, Union, cast +from typing import Callable, Generic, Sequence, TypeVar, Union, cast T = TypeVar("T") -D = TypeVar("D", bound=Mapping) +D = TypeVar("D") class DictBuilder(Generic[D]): - def __init__(self, mapping_constructor: Callable[[dict], D] = dict): - self.constructor = mapping_constructor + def __init__(self, constructor: Callable[[dict], D] = dict): + self.constructor = constructor def __getitem__(self, args: Union[slice, T, Sequence[Union[slice, T]]]) -> D: if not isinstance(args, tuple):