Fix deprecated use of List#28821
Fix deprecated use of List#28821Fidget-Spinner merged 1 commit intopython:mainfrom MicaelJarniac:patch-2
Conversation
Some typing examples were still using `List[...]` instead of `list[...]`. https://docs.python.org/3/library/typing.html#typing.List "Deprecated since version 3.9: builtins.list now supports []. See PEP 585 and Generic Alias Type."
|
This PR is essentially #28814 but targeting the correct branch this time, and fixing two extra occurrences of |
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
|
I've signed the CLA yesterday, as soon as it asked me to, so I think it should show up here soon. |
Fidget-Spinner
left a comment
There was a problem hiding this comment.
Thank you for retargeting against main.
|
What is wrong with using a member of the |
As far as I know, although
So in my opinion it makes more sense to use the new For me, examples, especially those in the official documentation, should be as up-to-date and "correct" as possible, showing the best practices and the right way of doing things, at least whenever possible. I believe that having examples that are outdated, using deprecated things, and so on can lead to confusion. |
|
What Ken Jin said. And this is in examples for something else (TypeGuard) that is in typing.py. There’s no particular reason to use deprecated idioms for parts of the example that are just illustrative. |
|
Thanks @MicaelJarniac for the PR, and @Fidget-Spinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
|
GH-28825 is a backport of this pull request to the 3.10 branch. |
) The ``List[...]`` form is deprecated since 3.9. (cherry picked from commit a98b273) Co-authored-by: Micael Jarniac <[email protected]>
|
Thank you @MicaelJarniac for the fix. |
Some typing examples were still using
List[...]instead oflist[...].https://docs.python.org/3/library/typing.html#typing.TypeGuard
https://docs.python.org/3/library/typing.html#typing.ForwardRef