The Wayback Machine - https://web.archive.org/web/20250530083531/https://github.com/python/cpython/issues/100925
Skip to content

Improve layout of the documentation for array #100925

Closed
@ad-chaos

Description

@ad-chaos

Documentation

Taking a look at the documentation for array and specifically the methods and module level attributes it defines, we see the following.

Screenshot 2023-01-11 at 12 00 02 AM

The layout — mentioning a module level constant array.typecodes after the array class description and before the methods on the type, would suggest that typecodes is an attribute of the array type, but it is actually an attribute of the array module

If one reads carefully they'll notice the line that states

The following data items and methods are also supported:

But an eye that skims past that text might mistake it for being an attribute of the array type.

Maybe a clear demarcation between the module definitions and the functions defined by the array type would be more helpful.

Taking a look at another standard library datatype collections.Counter, here the class methods are shown right below its description.

The datetime module has a section that defines module level constants and then shows the types.

It would be nice to follow the same pattern for array.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions