-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Add common issue docs for PEP585 syntax update #14246
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
base: master
Are you sure you want to change the base?
Add common issue docs for PEP585 syntax update #14246
Conversation
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.
Thanks! I've left a few suggestions below.
Main points:
- It's PEP 585, not PEP 584 :)
- Stick to <=80 characters per line where possible.
type
is a builtin name, but it's not a keyword- Use Sphinx roles to add links where appropriate
9bf1d9a
to
b595128
Compare
Thanks I addressed all your points. Didn't know of the sphinx roles and links. The off by one error is funny 🤣 I left you two extra questions |
You need to update the title of the PR as well ;) |
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.
Thanks! A few more points:
b595128
to
a9e081d
Compare
Done!
Addressed them and pushed. One question from my side. Here I asked you if you know the sphinx link to type for the docs. Any idea? This does not seem to render properly. But I see the same problem in other places in the docs as per my comment. |
Hmm, maybe try
|
a9e081d
to
792fb72
Compare
Yeah! That seems to work! Generates a proper link to: https://docs.python.org/3/library/functions.html#type I pushed it to the PR. Follow up question then. There is one more place in the docs where this needs fixing. Should I do it in this PR and a separate commit? A different PR? I am not sure what workflow you guys prefer. |
That would be a very welcome fix, but definitely best to do it as a separate PR, since it's a different issue to the thing being tackled here :) |
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.
Looks great now! Just two minor points:
As discussed with @AlexWaygood in python#14245 (comment) adding a common issue entry for the problem of hitting overshadowing a built-in keyword when upgrading to PEP585 syntax
792fb72
to
281d279
Compare
Addressed both. And also opened that follow-up PR. |
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!
It's a bit weird to frame this around PEP 585, when PEP 585 doesn't really do anything special here: you can run into the exact same problem with types like I would also recommend removing the recommendation to use |
Thank you for the review @JelleZijlstra @AlexWaygood. So how would you like me to proceed with the PR to get it merged? Add the section as is under the section you recommended removing:
|
Yes, I'd recommend adding a shortened text under the existing section. It's probably helpful to use |
Switch :py:func:type to py:class:type in type_narrowing.rst. The former does not render properly in the docs This is a tiny follow up from #14246 (comment)
As discussed with @AlexWaygood in #14245 (comment) adding a common issue entry for the problem of hitting overshadowing a built-in keyword when upgrading to PEP584 syntax