This commit is contained in:
2020-10-22 22:42:01 +08:00
parent 0019d4034c
commit 376f5caeb7
11 changed files with 140 additions and 29 deletions

View File

@@ -53,11 +53,9 @@ class _Registry:
else:
raise TypeError(f'cfg must be a dict or a str, but got {type(cfg)}')
for k in args:
assert isinstance(k, str)
if k.startswith("_"):
warnings.warn(f"got param start with `_`: {k}, will remove it")
args.pop(k)
for invalid_key in [k for k in args.keys() if k.startswith("_")]:
warnings.warn(f"got param start with `_`: {invalid_key}, will remove it")
args.pop(invalid_key)
if not (isinstance(default_args, dict) or default_args is None):
raise TypeError('default_args must be a dict or None, '