bpo-31567: Use decorator markup for staticmethod()/classmethod() by dmiyakawa · Pull Request #3959 · python/cpython
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that this should be decorator: classmethod; the version with arguments is probably used for functions that are decorator factories.
(For example, @functools.lru_cache(max_size=20) gets arguments and returns a decorator which is then applied to the decorated function; the markup must show clearly if people are expected to call @decorator or @decorator_factory().)
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.
Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.
I have made the requested changes; please review again.
Removed "(function)" for both classmethod and staticmethod. Since the following explanations points to the name "function" in the arg, I modified the description too (I mimicked the line in @functools.singledispatch)
https://docs.python.org/3.6/library/functools.html#functools.singledispatch
Transforms a function into a single-dispatch generic function.
Thanks for making the requested changes!
@merwok: please review the changes made to this pull request.
Yes that’s the one in created from github. I made another commit on my laptop and can’t push it to your fork or make a PR: merwok@59bc4a7
Thanks @dmiyakawa for the PR, and @merwok for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6.
🐍🍒⛏🤖
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
(cherry picked from commit 0e61e67)
Sorry, @dmiyakawa and @merwok, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 0e61e67a57deb4abc677808201d7cf3c38138e02 2.7
I’ll leave 2.7 alone, nothing already uses the decorator markup (maybe it’s not even supported in the sphinx version used by 2.7).
FTR I think the push issue was due to using an https URL for your fork rather than ssh!
I just pushed commits to the backport PR owned by the miss-islington bot.
merwok pushed a commit that referenced this pull request
(cherry picked from commit 0e61e67)