KEMBAR78
Replace `List[X]` with `list[X]` in docs by NickCrews · Pull Request #11450 · python/mypy · GitHub
Skip to content

Conversation

NickCrews
Copy link
Contributor

@NickCrews NickCrews commented Nov 3, 2021

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 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.

Test Plan

CI looks like it passed.

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.
@NickCrews
Copy link
Contributor Author

Uh oh @hauntsaninja, by reviewing #11377 it looks like you have made yourself vulnerable to being a reviewer for this, too!

@hauntsaninja hauntsaninja merged commit 4669929 into python:master Nov 9, 2021
@hauntsaninja
Copy link
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.

@NickCrews
Copy link
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!

@NickCrews NickCrews deleted the fix-List-to-list branch November 9, 2021 04:29
tushar-deepsource pushed a commit to DeepSourceCorp/mypy that referenced this pull request Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants