Closed frankenjoe closed 2 years ago
Merging #51 (adb84c3) into master (a12c77c) will not change coverage. The diff coverage is
100.0%
.
Impacted Files | Coverage Δ | |
---|---|---|
audobject/core/define.py | 100.0% <100.0%> (ø) |
|
audobject/core/dictionary.py | 100.0% <100.0%> (ø) |
|
audobject/core/object.py | 100.0% <100.0%> (ø) |
|
audobject/core/testing.py | 100.0% <100.0%> (ø) |
This implementation also introduces another way of hiding arguments as a side effect. If you use **kwargs
but not pass them to super.__init__()
I guess they are not stored, but handled like hidden arguments.
Or will it raise an error?
This implementation also introduces another way of hiding arguments as a side effect. If you use **kwargs but not pass them to super.init() I guess they are not stored, but handled like hidden arguments.
Yep, and it's actually quite handy since we often use **kwargs
to capture deprecated arguments, which we don't want to serialize.
Or will it raise an error?
Nope
This implementation also introduces another way of hiding arguments as a side effect. If you use kwargs but not pass them to super.init**() I guess they are not stored, but handled like hidden arguments.
Yep, and it's actually quite handy since we often use
**kwargs
to capture deprecated arguments, which we don't want to serialize.Or will it raise an error?
Nope
Cool, can you then also add a test for it.
Cool, can you then also add a test for it.
Turns out since @audeer.deprecated_keyword_argument
removes the argument, we can even call super().__init__(**kwargs)
. I extended the test accordingly.
Fixes #50
Instead of serializing all attributes to YAML, we only store the attributes that are actually passed as keyword arguments. Therefore, we pass
kwargs
to the constructor of the base class.