Closed frankenjoe closed 3 years ago
Merging #27 (e35cf04) into master (3d93b62) will not change coverage. The diff coverage is
100.0%
.
Impacted Files | Coverage Δ | |
---|---|---|
audobject/core/api.py | 100.0% <100.0%> (ø) |
|
audobject/core/utils.py | 100.0% <100.0%> (ø) |
Note that it is still not possible to override arguments path_or_stream
and include_version
with to_yaml()
, as these are arguments of to_yaml()
. Of course, we could also change kwargs
to a dictionary in to_yaml()
, but that would break a lot of code. But at least here it is more obvious for the user that this is not possible.
I decided to also deprecate the use of **kwargs**
with to_yaml()
and to_yaml_s()
.
As **kwargs
is deprecated I think it should not appear in the documentation, e.g.
As
**kwargs
is deprecated I think it should not appear in the documentation, e.g.
But if we remove it from the function signature, we are no longer backward compatible.
As
**kwargs
is deprecated I think it should not appear in the documentation, e.g.But if we remove it from the function signature, we are no longer backward compatible.
Yes, you are right. So I guess we just stick with it until we remove it completely then.
Closes #26
As reported in #26 it is not possible to override arguments named
root
ord
withfrom_yaml()
andfrom_yaml_s()
. This is becausefrom_dict()
(which is called by the other functions) has arguments with those names, i.e. we have a clash if we also try to pass them also as keyword arguments. As a solution,**kwargs
is deprecated and instead additional keyword arguments can be passed as a dictionary.The other solution proposed in #26 would be to rename the arguments of
from_dict()
to something that is not likely chosen by the user. However, the solution proposed here seems to be cleaner. The nameoverride_args
also expresses better its purpose than**kargs
.A test is added to verify we can now override an argument with name
root
.