New submission from Daisuke Miyakawa:

I can see inconsistency in library documentation around functions that are 
suitable for decorators. I'd like to clarify if it is based on my 
misunderstanding, or a real documentation problem.

Examples:

- https://docs.python.org/3/library/functions.html#staticmethod
- https://docs.python.org/3/library/functools.html#functools.lru_cache

Both staticmethod() and functools.lru_cache() are used with decorator 
expressions, while they have slightly different explanations.

The first one looks like just a usual function while the detailed explanations 
say it is used with decorator expression. The second one is what I don't 
understand; it says "@functools.lru_cache()", where the function name is 
"decorated" with @ in the doc. 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?

I don't know which is better, but I believe consistency is good. Some other 
examples :

- https://docs.python.org/3/library/contextlib.html?highlight=decorator  -> @ 
here
- https://docs.python.org/3/library/unittest.mock.html#unittest.mock.patch -> 
no @ here
- https://docs.python.org/2.7/library/functools.html#functools.lru_cache -> Old 
functools does not have @

----------
assignee: docs@python
components: Documentation
messages: 302830
nosy: dmiyakawa, docs@python
priority: normal
severity: normal
status: open
title: Inconsistent documentation around decorators
type: behavior
versions: Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31567>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to