Skip to content

Reconsider position of Attributes and Methods sections #608

Open
@timhoffm

Description

@timhoffm

#571 changed the section order to move Attributes and Methods right behind Parameters.

The order is now

sections = {
"Signature": "",
"Summary": [""],
"Extended Summary": [],
"Parameters": [],
"Attributes": [],
"Methods": [],
"Returns": [],
"Yields": [],
"Receives": [],
"Other Parameters": [],
"Raises": [],
"Warns": [],
"Warnings": [],
"See Also": [],
"Notes": [],
"References": "",
"Examples": "",
"index": {},
}

For classes, we can get the order Paramters > Attributes > Methods > Other Parameters , which IMHO is not quite usable as the Other Parameters are very far away from Parameters.

We have to consider that the ordering should work both for classes and methods. As far as I understand, the motivation for Other Parameters is to deemphasise them and for methods to have the (typically short) sections Returns/Yields/Receives closer to the top.

I propose to move Attributes and Methods below Other Parameters, i.e.

Parameters
Returns
Yields
Receives
Other Parameters
Attributes
Methods
  • There's no change for functions / methods as the don't use Attributes and Methods
  • There's no change for classes without "Other Parameters" because they don't use Returns/Yields/Receives
  • For classes with "Other Parameters" the sequence is "Parameters > Other Parameters > Attributes > Methods", which I think is better because the first two are input values to the construtor, while the other two are properties of the class.

One could argue that one should alternatively not use "Other Parameters" if one wants to render them next to each other anyway. But I claim it's still helpful to de-emphasize additional parameters through that extra section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions