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 <>
> 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)
Date User Action Args
2017-10-02 18:47:07eric.araujosetrecipients: + eric.araujo, docs@python, dmiyakawa
2017-10-02 18:47:07eric.araujosetmessageid: <>
2017-10-02 18:47:07eric.araujolinkissue31567 messages
2017-10-02 18:47:07eric.araujocreate