-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Description
Following https://docs.scipy.org/doc/scipy/dev/missing-bits.html#required-keyword-names, we should use the removal of keywords as an opportunity to turn relevant arguments in the signature into keyword-only arguments.
This needs a separate deprecation from the one that just warns about removing a given kwarg (although if the kwarg being deprecated is early in the signature, it might end up being equivalent), to warn users that feed kwargs positionally that they need to pass them as keywords going forward.
The mechanism for emitting a good deprecation warning on this is not so straight-forward, but scikit-learn came up with a good helper for their own effort in this direction that we can vendor here.
This is aimed particularly at the functions being touched in #18624, but is in force for all function signatures where kwargs are being scheduled for removal (or otherwise changed).
More context: #14714
TODO: follow-ups to
- <PRs that introduce signature changes during 1.15>