Open mathause opened 3 hours ago
I think that would be the correct validity check but we need to keep it even after the deprecation period. So maybe not worth it.
def _check_keys_args_kwargs(keys_args, keys_kwargs, keys):
if "keys" not in keys:
if "keys" in keys_kwargs:
if keys_args is not None:
raise TypeError()
else:
warnings.warn("deprecated")
# raise TypeError() # after the deprecation period
return keys_kwargs.pop("keys"), keys_kwargs
if "keys" in keys_kwargs and isinstance(keys_kwargs["keys"], dict):
raise TypeError()
return keys_args, keys_kwargs
we could use a positional-only argument for
keys
Originally posted by @mathause in https://github.com/mathause/filefinder/issues/97#issuecomment-2402366535
This would allow us to use
"{keys}"
as placeholder. However, optional positional-only keywords in conjunction with**kwargs
are bothersome: you need to do all the validity checks yourself.