Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Replace List[X] with list[X] in docs - #11450

Merged
hauntsaninja merged 3 commits into
python:masterfrom
NickCrews:fix-List-to-list
Nov 9, 2021
Merged

Replace List[X] with list[X] in docs#11450
hauntsaninja merged 3 commits into
python:masterfrom
NickCrews:fix-List-to-list

Conversation

@NickCrews

@NickCrews NickCrews commented Nov 3, 2021

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

Comment thread docs/source/cheat_sheet_py3.rst Outdated
Comment thread docs/source/cheat_sheet_py3.rst Outdated
Comment thread docs/source/getting_started.rst Outdated
Comment thread docs/source/cheat_sheet_py3.rst Outdated
@hauntsaninja
hauntsaninja merged commit 4669929 into python:master Nov 9, 2021
@hauntsaninja

Copy link
Copy Markdown
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
Copy Markdown
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