v2
This commit is contained in:
@@ -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, '
|
||||
|
||||
Reference in New Issue
Block a user