You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Target subclasses have grown somewhat unwieldy over the years in 2 ways:
Some parameters logically related are spread apart in the signature due to the order in which they were introduced in the code.
A lot of these parameters are shoveled around to super().__init__(), making adding new parameters more error prone than it should be and duplicating default values for those everywhere.
To address that, moving most arguments to being keyword-only would ensure:
the user code stays sane
Target subclasses could mostly be forwarding **kwargs to the super class where possible.
We would not duplicate default values everywhere anymore
The main cons are:
It's an API breaking change. However:
I would suspect the vast majority of user code either does not set those parameters or already uses keyword arguments syntax
Once the user code is fixed, the user code is backward and forward compatible so they can still switch to older devlib versions if needed.
This can be done after a grace period where we emit a DeprecationWarning when any positional argument is used.
Depending on how the documentation is dealt with, this can affect the visible signature. However:
The current style of doc is completely separate from the code and would not be affected.
The equivalent docstring style would not really be affected, and decorators can be implemented to make the signature look better (I did in LISA and it works fine).
There is a reasonable chance that type annotation these days can help recover decent autocompletion on a **kwargs signature, but I'd need to check the details.
The text was updated successfully, but these errors were encountered:
Target subclasses have grown somewhat unwieldy over the years in 2 ways:
super().__init__()
, making adding new parameters more error prone than it should be and duplicating default values for those everywhere.To address that, moving most arguments to being keyword-only would ensure:
**kwargs
to the super class where possible.The main cons are:
DeprecationWarning
when any positional argument is used.**kwargs
signature, but I'd need to check the details.The text was updated successfully, but these errors were encountered: