Skip to content

Improve layout of the documentation for array #100925

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ad-chaos opened this issue Jan 10, 2023 · 2 comments
Closed

Improve layout of the documentation for array #100925

ad-chaos opened this issue Jan 10, 2023 · 2 comments
Labels
docs Documentation in the Doc dir

Comments

@ad-chaos
Copy link

ad-chaos commented Jan 10, 2023

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

@ad-chaos ad-chaos added the docs Documentation in the Doc dir label Jan 10, 2023
@theWiseAman
Copy link

theWiseAman commented Jan 22, 2023

@ad-chaos Okay let me author a pull request for this.

Edit: I have created the PR #101239 for it. @gvanrossum Can you please review and merge it?
This is how it looks now.
image

theWiseAman added a commit to theWiseAman/cpython that referenced this issue Jan 22, 2023
ezio-melotti pushed a commit that referenced this issue Feb 3, 2023
* Move array methods under class in array doc

* Fix a few internal references related to the touched lines
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 3, 2023
…H-101485)

* Move array methods under class in array doc

* Fix a few internal references related to the touched lines
(cherry picked from commit 1b60456)

Co-authored-by: C.A.M. Gerlach <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 3, 2023
…H-101485)

* Move array methods under class in array doc

* Fix a few internal references related to the touched lines
(cherry picked from commit 1b60456)

Co-authored-by: C.A.M. Gerlach <[email protected]>
miss-islington added a commit that referenced this issue Feb 3, 2023
* Move array methods under class in array doc

* Fix a few internal references related to the touched lines
(cherry picked from commit 1b60456)

Co-authored-by: C.A.M. Gerlach <[email protected]>
miss-islington added a commit that referenced this issue Feb 3, 2023
* Move array methods under class in array doc

* Fix a few internal references related to the touched lines
(cherry picked from commit 1b60456)

Co-authored-by: C.A.M. Gerlach <[email protected]>
@hauntsaninja
Copy link
Contributor

Thanks, looks like this was refactored

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

3 participants