mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-02-22 05:05:43 -05:00
dictscheme: fix type hinting
This commit is contained in:
parent
a0c4036390
commit
2e504b7b00
1 changed files with 5 additions and 2 deletions
|
@ -52,7 +52,7 @@ class DictScheme(Munch):
|
|||
_sparse: ClassVar[bool] = False
|
||||
|
||||
def __init__(self, d: Mapping = {}, validate: bool = True, **kwargs):
|
||||
self.update(d | kwargs, validate=validate)
|
||||
self.update(dict(d) | kwargs, validate=validate)
|
||||
|
||||
@classmethod
|
||||
def transform(
|
||||
|
@ -269,10 +269,13 @@ class DictScheme(Munch):
|
|||
) -> str:
|
||||
import yaml
|
||||
yaml_args = {'sort_keys': False} | yaml_args
|
||||
return yaml.dump(
|
||||
dumped = yaml.dump(
|
||||
self.toDict(strip_hidden=strip_hidden, sparse=sparse),
|
||||
**yaml_args,
|
||||
)
|
||||
if dumped is None:
|
||||
raise Exception(f"Failed to yaml-serialse {self}")
|
||||
return dumped
|
||||
|
||||
def toToml(
|
||||
self,
|
||||
|
|
Loading…
Add table
Reference in a new issue