Skip to content

Commit

Permalink
fix(type): allow non-mapping types
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Apr 16, 2024
1 parent c2aba88 commit 1092483
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = []
Expand Down
8 changes: 4 additions & 4 deletions src/literal_dict.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down

0 comments on commit 1092483

Please sign in to comment.