This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: doc Some classes are treated as functions in Built-in Functions
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7, Python 3.6, Python 2.7
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: docs@python Nosy List: adelfino, docs@python, eric.smith, rhettinger
Priority: normal Keywords: patch

Created on 2018-09-08 22:29 by adelfino, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9119 closed adelfino, 2018-09-08 22:31
Messages (5)
msg324864 - (view) Author: Andrés Delfino (adelfino) * (Python triager) Date: 2018-09-08 22:29
Beyond other classes documented as functions (classmethod, enumerate, filter, map, reversed, staticmethod, super and zip), the following issues exist:

* memoryview, range, and tuple are marked as functions
* complex and object treat themselves as functions in their descriptions

Attached PR fixes this.
msg324866 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2018-09-08 23:11
I'm not sure this is an improvement. While it's true that 'complex' is a class, it's described here as a function. Same as 'int'. The fact that it's a function or class isn't so important here.

I suspect it will confuse people to have something described as a class in the section titled 'Built-in Functions'. We wouldn't want to change the section to the more correct 'Built-in Callables'.
msg324867 - (view) Author: Andrés Delfino (adelfino) * (Python triager) Date: 2018-09-08 23:39
Please note that several classes are marked as such (e.g., int, float, str, dict, list) and bool for example treats itself as a class in it's description.

Perhaps your concerns applies to all those ocurrences too?
msg324868 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2018-09-08 23:46
Ah, you're correct. I just looked for the word "class" inside the "int" text, and it doesn't appear there: I thought it was deliberately left out. But it does show up in the sub-section header (before "int" itself). Sorry about that.

The text changes look good, then. I don't know enough about Sphinx to know how changing the meta-data affects things.
msg324869 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2018-09-09 00:35
I concur with Eric.  These were marked as functions in the function section of the docs.  Their role as classes is noted in the body.  And their role as complete classes with a listing of their methods is documented elsewhere.
History
Date User Action Args
2022-04-11 14:59:05adminsetgithub: 78793
2018-09-09 00:35:04rhettingersetstatus: open -> closed

nosy: + rhettinger
messages: + msg324869

resolution: rejected
stage: patch review -> resolved
2018-09-08 23:46:09eric.smithsetmessages: + msg324868
2018-09-08 23:39:51adelfinosetmessages: + msg324867
2018-09-08 23:11:13eric.smithsetnosy: + eric.smith
messages: + msg324866
2018-09-08 22:31:30adelfinosetkeywords: + patch
stage: patch review
pull_requests: + pull_request8572
2018-09-08 22:29:55adelfinocreate