You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Group the docs of similar methods in stdtypes.rst #67748
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2015-03-02.09:28:10.370>labels= ['easy', 'type-feature', 'docs']
title='Group the docs of similar methods in stdtypes.rst'updated_at=<Date2019-08-09.02:38:23.499>user='https://github.com/ezio-melotti'
The Doc/library/stdtypes.rst page describes in detail the built-in types and their methods. As suggested in bpo-21777 (see the comments on Rietveld), it might be a good idea to group the documentation of some similar methods, such as {r|l|}just, {r|l|}strip, {r|}partition, {r|}index, and {r|}find.
This will remove some duplication, make the page shorter and easier to navigate, and make the methods easier to discover. Adding tables containing the methods for each types has also been proposed.
Here is a patch that groups similar methods of the str() class together at various levels.
I added an alphabetical index of the methods, currently as a big paragraph of hyperlinks in the existing String Methods section. Then I added the following seven new sections. Ideally they would be ordered from important to obscure.
String Formatting
Searching and Replacing
Splitting and Joining
String Classification
Case Manipulation
Padding and Stripping
Translation and Encoding
Within each section, most methods remain separate with no change to their descriptions. Some are grouped under a single description, where a there is an obvious pattern. I have tried put closely related methods nearby, while putting important and simple methods higher up, and moving their obscure and complex counterparts lower down.
Depending on outcome of these changes to the string methods, I may also be interested in doing a similar job to the bytes() and bytearray() methods.
I don't think this should be done. Instead, add a table at the top listing the functions in groups, possibly linking to the alphabetical details docs below.
When looking a what a string method does, alphabetical makes the search easier than having to guess which group something is in before you can find it.
I hope this is OK, but I created a version of the patch with a table as Raymond suggested. I didn't know how to make a patch, so I did it in a PR. I wanted to have a comparison available to see the differences between the two versions. I used the original categories as defined by Martin.
I could also add a bytearray column if the table looks reasonable.
Activity
ezio-melotti commentedon Mar 2, 2015
The Doc/library/stdtypes.rst page describes in detail the built-in types and their methods. As suggested in bpo-21777 (see the comments on Rietveld), it might be a good idea to group the documentation of some similar methods, such as {r|l|}just, {r|l|}strip, {r|}partition, {r|}index, and {r|}find.
This will remove some duplication, make the page shorter and easier to navigate, and make the methods easier to discover. Adding tables containing the methods for each types has also been proposed.
vadmium commentedon May 26, 2015
Here is a patch that groups similar methods of the str() class together at various levels.
I added an alphabetical index of the methods, currently as a big paragraph of hyperlinks in the existing String Methods section. Then I added the following seven new sections. Ideally they would be ordered from important to obscure.
Within each section, most methods remain separate with no change to their descriptions. Some are grouped under a single description, where a there is an obvious pattern. I have tried put closely related methods nearby, while putting important and simple methods higher up, and moving their obscure and complex counterparts lower down.
Depending on outcome of these changes to the string methods, I may also be interested in doing a similar job to the bytes() and bytearray() methods.
csabella commentedon May 20, 2017
Hi Martin,
Do you think it would be good to move forward with this as a PR?
Thanks!
rhettinger commentedon May 21, 2017
I don't think this should be done. Instead, add a table at the top listing the functions in groups, possibly linking to the alphabetical details docs below.
When looking a what a string method does, alphabetical makes the search easier than having to guess which group something is in before you can find it.
csabella commentedon May 22, 2017
I hope this is OK, but I created a version of the patch with a table as Raymond suggested. I didn't know how to make a patch, so I did it in a PR. I wanted to have a comparison available to see the differences between the two versions. I used the original categories as defined by Martin.
I could also add a bytearray column if the table looks reasonable.
Thanks!
gh-67748: DOC:Add summary table for str methods in stdtypes.rst (GH-1709
OTheDev commentedon Jul 31, 2025
@encukou Can this issue be closed?