Replace List[X] with list[X] in docs - #11450
Merged
Merged
Conversation
As well as `Dict[X, Y]` -> `dic[X, Y]`, etc. This is a follow-up to python#11377, where just a single page of the docs was transitioned. I did a grep through the docs/ directory for anything matching "List[", "Dict[", "Tuple[", and "Set[" and corrected any examples. Perhaps I missed something, but my goal was to clean all of the docs. I tried to strike a balance of how explicit to be: In places related to collections, such as the "Explicit types for collections" section of `type_inference_and_annotations.rst`, I kept in notes about the differences between `List` and `list`. But in most examples that were focused on some other topic, I just deleted any reference to `typing.List`. I thought any notes there would just add noise. There also is a correction to `command_line.rst`, I tested using `--disallow-any-generics` with `list[int]` and it works fine. There are a few typos and style fixes scattered throughout as well when I touched them.
Contributor
Author
|
Uh oh @hauntsaninja, by reviewing #11377 it looks like you have made yourself vulnerable to being a reviewer for this, too! |
hauntsaninja
reviewed
Nov 9, 2021
hauntsaninja
reviewed
Nov 9, 2021
Collaborator
|
Thanks! I walked back a little of the change to the cheat sheet... we get some users who are very new to Python, so it's worth trying to shield them from some of the details. |
Contributor
Author
|
Thanks a lot @hauntsaninja! It's really nice to contribute and for those contributions to land so quickly. I appreciate the work you're doing! |
tushar-deepsource
pushed a commit
to DeepSourceCorp/mypy
that referenced
this pull request
Jan 20, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As well as
Dict[X, Y]->dic[X, Y], etc.This is a follow-up to #11377, where
just a single page of the docs was transitioned.
I did a grep through the docs/ directory for anything
matching "List[", "Dict[", "Tuple[", and "Set["
and corrected any examples. Perhaps I missed something, but
my goal was to clean all of the docs.
I tried to strike a balance of how explicit to be: In places related
to collections, such as the "Explicit types for collections" section
of
type_inference_and_annotations.rst, I keptin notes about the differences
between
Listandlist. But in most examplesthat were focused
on some other topic, I just deleted any reference to
typing.List. I thought any notes there wouldjust add noise.
There also is a correction to
command_line.rst, I tested using--disallow-any-genericswithlist[int]and it works fine.There are a few typos and style fixes scattered throughout as well when
I touched them.
Test Plan
CI looks like it passed.