Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
BUG,ENH: make deprecated decorator work (and more flexibly) #7651
Conversation
efiring
referenced
this pull request
Dec 20, 2016
Merged
Improve deprecation documentation. Closes #7643 #7646
efiring
added this to the
2.1 (next point release)
milestone
Dec 20, 2016
|
My two cents on our deprecation functions is that they are extremely complicated to use and hard to predict what the deprecation message is going to be. Is there a way to simplify that? |
|
This PR should make it quite a bit easier; in most cases, just leave all kwargs but the last as defaults (unless "alternative" can be specified) and put additional information in "addendum". That way, the message always starts out with the standard pattern, automatically identifying what is being deprecated and when. Also, part of the difficulty you experienced might have been because the behavior did not match the documentation--there was a huge bug, which this PR fixes. Additional steps to make it easier would be adding full examples to the documentation, showing exactly what happens by default, and with common combinations of kwargs. |
|
My strategy is currently to git grep and see what people do or to provide explicitely the deprecation message :) |
|
@amueller 's https://github.com/amueller/futurepast might be interesting to look at here as well. |
NelleV
merged commit 266d524
into matplotlib:master
Dec 22, 2016
|
unfortunately |
|
I think the system we have right now, with the present PR merged, serves our purposes well. |
efiring commentedDec 20, 2016
to substitute arguments for string formats in user-supplied
message argument.
now the string format specifications also use "name", not "func".
convenient argument substitution, can be used, and additional
explanation can be appended as a plain text string.
Closes #7647.