Skip to content

Commit

Permalink
feat: model.cast to allow dict[str, Any]
Browse files Browse the repository at this point in the history
  • Loading branch information
minenwerfer committed Aug 26, 2023
1 parent acae19b commit 9a09176
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/micromodel/micromodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, model_type: typing.Callable[[typing.Any], T], ct: dict[str, t
self.model_type = model_type
self.ct = ct

def cast(self, target: T | dict[typing.Never, typing.Never]): return typing.cast(T, target)
def cast(self, target: T | dict[str, typing.Any]): return typing.cast(T, target)
def validate(self, target: T, options: ValidationOptions = {}): return validate(self.model_type, typing.cast(typing.Any, target), options, self.ct)

def raise_missing_key(k: int | str):
Expand Down

0 comments on commit 9a09176

Please sign in to comment.