[docs] [issue10893] The docs mark staticmethod as a function
report at bugs.python.org
Thu Jan 13 23:10:49 CET 2011
Ram Rachum <cool-rr at cool-rr.com> added the comment:
So if int is officially a class, why not start doing :class:`int` instead of :func:`int`?
"they’re marked up as functions, so you should treat them as functions."
Here, I've treated staticmethod as a function:
>>> assert isinstance(staticmethod, types.FunctionType)
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
assert isinstance(staticmethod, types.FunctionType)
I get an error.
So I understand that you are using Sphinx's :func: role in a liberal way; You consider it okay to use it to mark anything that is callable, regardless of whether it's a function or a class. Am I right?
This looks to me like an abuse of Sphinx notation. When I read documentation I don't want to be second-guessing the author's intentions. If someone writes :func:`whatever` I expect `whatever` to be a function and not a class.
Perhaps we need a :callable: role?
status: closed -> open
Python tracker <report at bugs.python.org>
More information about the docs