-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-40979: refactored typing.rst; same content, new sub-sections and ordering #21574
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
Conversation
This comment has been minimized.
This comment has been minimized.
Is this still in progress? You seem to have many commits and the tests still don't pass. Also, I'm not so keen on alphabetizing entries. I'd rather order them from most to least important. @rhettinger Do you agree? Finally the |
Thanks, @gvanrossum.
I am done with the PR, unless changes are requested.
I made one huge commit with all changes, then a friend suggested it would be hard to review, so for the benefit of reviewers I made several commits working section by section. This makes it easy to verify that no content went missing during the reorganization.
The last failing check was the lack of a blurb, which I added about 10 hours ago, and then I saw all checks passing. I did make some rookie mistakes before, but they are all fixed. Please let me know which tests are not passing now.
I used "importance" as the main criterion for ordering the sections. Within each section, I believe the user is better served with an alphabetical listing when the section is longer than a screenful. I wouldn't know how to rank the entries in Generic ABCs by importance. From an editorial perspective, orderings that are not clear to the reader are not helpful.
The entries for (IO, BytesIO, TextIO) and (Pattern, Match) appear together in the |
Hm; I sometimes like to read documentation starting from the top (since where else are you going to start? :-) until it gets boring, and then it's nice to have it be in some useful order. Alphabetical order may break a tie, but it was invented in order to make manual search easier. Since we have search now, that no longer applies, and we can do something more useful. (How do you organize things in your books? Hopefully not alphabetical.) If you really think it ought to be alphabetical per section, maybe we can introduce sub-sections. For example, here's a possible way to split the first two sections in parts:
I have issues with the "generic ABCs" too: some of them are not generic, some are not abstract, and probably these should be separated by origin module, i.e. abc, collections.abc, and other modules. I assume BytesIO is a typo for BinaryIO. I would also separate functions and decorators into two sub-sections, and honestly there's no reason to put TYPE_CHECKING in the same section as AnyStr and Text. |
Yes, that makes sense. |
Great proposal, @gvanrossum, thanks. I will follow it, but I have a couple of questions:
Agreed, I will make a proposal to split that section.
Yes.
|
No, it's special because it is variadic. You cannot create a type like that using inheritance from
Of course. I did not mean to prescribe what you could write in the introduction of each section or subsection -- I only meant to clarify my intention for the grouping to you, so you can write something.
I am fine with a section on its own for I am a little hesitant to document |
Are you going to do the proposed reordering? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I think I'll merge it now.
@gvanrossum: Please replace |
…ions and ordering (python#21574) Also added PEP 585 deprecation notes.
Thanks @ramalho for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
Thanks @ramalho for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry, @ramalho and @gvanrossum, I could not cleanly backport this to |
Sorry @ramalho and @gvanrossum, I had trouble checking out the |
…b-sections and ordering (pythonGH-21574) Also added PEP 585 deprecation notes. (cherry picked from commit ab72fde) Co-authored-by: Luciano Ramalho <[email protected]>
GH-21843 is a backport of this pull request to the 3.9 branch. |
…b-sections and ordering (GH-21574) (#21843) Also added PEP 585 deprecation notes. (cherry picked from commit ab72fde) Co-authored-by: Luciano Ramalho <[email protected]>
…ions and ordering (python#21574) Also added PEP 585 deprecation notes.
…ions and ordering (python#21574) Also added PEP 585 deprecation notes.
They were originally removed in pythonGH-10173 per bpo-35089, but then readded in pythonGH-21574. Cf. bpo-38291 for decision to remove.
…26113) They were originally removed in pythonGH-10173 per bpo-35089, but then readded in pythonGH-21574. Cf. bpo-38291 for decision to remove. (cherry picked from commit 8a76683) Co-authored-by: Sebastian Rittau <[email protected]>
…26113) They were originally removed in pythonGH-10173 per bpo-35089, but then readded in pythonGH-21574. Cf. bpo-38291 for decision to remove. (cherry picked from commit 8a76683) Co-authored-by: Sebastian Rittau <[email protected]>
…26113) They were originally removed in pythonGH-10173 per bpo-35089, but then readded in pythonGH-21574. Cf. bpo-38291 for decision to remove.
Here is how I reorganized the content previously in the "Classes, functions, and decorators" section:
https://bugs.python.org/issue40979