Author eric.araujo
Recipients dmiyakawa, docs@python, eric.araujo
Date 2017-10-02.18:47:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1506970027.58.0.213398074469.issue31567@psf.upfronthosting.co.za>
In-reply-to
Content
> What does @ mean here? If there's some meaning, the next question is, why doc for staticmethod()
> (and classmethod() in the same page) does not have it?

@ means that the function is meant to be used as a decorator (the markup looks like the actual code).

staticmethod and classmethod are older than the decorator syntax, which is older than the special sphinx markup for decorators (they used to just use the function markup).

For unittest.mock.patch, its result can be used as a decorator or as a context manager, so the current markup (no @) makes sense.

If you want to update staticmethod and classmethod to use the decorator markup, please send a pull request!  (more info in the devguide)
History
Date User Action Args
2017-10-02 18:47:07eric.araujosetrecipients: + eric.araujo, docs@python, dmiyakawa
2017-10-02 18:47:07eric.araujosetmessageid: <1506970027.58.0.213398074469.issue31567@psf.upfronthosting.co.za>
2017-10-02 18:47:07eric.araujolinkissue31567 messages
2017-10-02 18:47:07eric.araujocreate