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
Group the docs of similar methods in stdtypes.rst #67748
Comments
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.
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. |
Hi Martin, Do you think it would be good to move forward with this as a PR? Thanks! |
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. Thanks! |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: