Skip to content

Commit

Permalink
fix: typing for dict, close #64
Browse files Browse the repository at this point in the history
  • Loading branch information
zifeo committed Dec 3, 2022
1 parent ce917b1 commit 9e54bce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dataconf/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import contextlib
import os
from typing import Any
from typing import List
from typing import Type
from urllib.parse import urlparse
Expand Down Expand Up @@ -47,7 +48,7 @@ def env(self, prefix: str, **kwargs) -> "Multi":
data = env_vars_parse(prefix, os.environ)
return self.dict(data, **kwargs)

def dict(self, obj: str, **kwargs) -> "Multi":
def dict(self, obj: dict[str, Any], **kwargs) -> "Multi":
conf = ConfigFactory.from_dict(obj)
return Multi(self.confs + [conf], self.strict, **kwargs)

Expand Down Expand Up @@ -97,7 +98,7 @@ def env(prefix: str, clazz: Type, **kwargs):
return multi.env(prefix, **kwargs).on(clazz)


def dict(obj: str, clazz: Type, **kwargs):
def dict(obj: dict[str, Any], clazz: Type, **kwargs):
return multi.dict(obj, **kwargs).on(clazz)


Expand Down

0 comments on commit 9e54bce

Please sign in to comment.