Skip to content

bpo-41559: Documentation for PEP 612 - #24000

Merged
gvanrossum merged 9 commits into
python:masterfrom
Fidget-Spinner:docs-pep612
Jan 2, 2021
Merged

bpo-41559: Documentation for PEP 612#24000
gvanrossum merged 9 commits into
python:masterfrom
Fidget-Spinner:docs-pep612

Conversation

@Fidget-Spinner

@Fidget-SpinnerFidget-Spinner commented Dec 29, 2020

Copy link
Copy Markdown
Member

Please skip news, it shares the same news entry as GH-23702, thanks!

https://bugs.python.org/issue41559

@Fidget-Spinner

Fidget-Spinner commented Dec 29, 2020

Copy link
Copy Markdown
MemberAuthor

@gvanrossum. Sorry, I did the reverse of what I'd initially promised - I was in a writing mood :). Really no hurry to review it though, we have a long way till 3.10 beta.

This felt more difficult to write than what I did for PEP 585 and PEP 604 combined! Thinking of useful examples which were also understandable by users and copy-pastable/fully working as is wasn't easy. Maybe this is a sign that the typing module needs some refactoring work by the future Docs WG people.

@Fidget-Spinner

Fidget-Spinner commented Dec 30, 2020

Copy link
Copy Markdown
MemberAuthor

Hmm I wonder if we should reorder the PEP-sized what's new items while we're at it. Strange that the current order is PEP 563, 613, 604, 612.

@gvanrossumgvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this very thorough doc update! I have just a few nits.

Next, do you want to help fixing the support for this in mypy? There's some code, but it's not working right.

.. note::
A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not
have correct ``__parameters__`` after substitution because
:class:`typing.ParamSpec` is intended primarily for static type checking.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to add this to the note, but privately I'm interested in an example where it goes wrong?

@Fidget-SpinnerFidget-SpinnerDec 31, 2020

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'''This example is from the typing module, though it will behave the same with the builtin GenericAlias'''fromtypingimportParamSpec, TypeVar, GenericP=ParamSpec('P')
T=TypeVar('T')
classX(Generic[P]): ...
# Empty tuple, because T is nested inside that listprint(X[int, str, T].__parameters__)

Comment threadDoc/library/typing.rst Outdated
Comment threadDoc/library/typing.rst Outdated
Comment threadDoc/library/typing.rst Outdated
Comment threadDoc/library/typing.rst Outdated
Comment threadDoc/library/typing.rst
Comment threadDoc/library/typing.rst Outdated
Comment threadDoc/library/typing.rst
Comment threadDoc/library/typing.rst Outdated
Co-Authored-By: Guido van Rossum <gvanrossum@users.noreply.github.com>
@Fidget-Spinner

Copy link
Copy Markdown
MemberAuthor

Thanks so much for this very thorough doc update! I have just a few nits.

Next, do you want to help fixing the support for this in mypy? There's some code, but it's not working right.

You're welcome! Unfortunately I have no clue how mypy works internally, so I don't think I'm the right person for that right now.

@gvanrossumgvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything else is fine now!

Comment threadDoc/library/typing.rst Outdated

@gvanrossumgvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay!

@Fidget-Spinner

Copy link
Copy Markdown
MemberAuthor

Thank you for taking the time to review this prosaic chunk of text. Getting this approved is an awesome way to start the new year!

BTW, test_nntplib seems to be failing for the entire cpython repo right now. I'm just going to wait it out and see if it magically fixes itself, or if the people at https://bugs.python.org/issue42794 find some other way to solve it.

@gvanrossum
gvanrossum merged commit 11276cd into python:masterJan 2, 2021
@Fidget-Spinner
Fidget-Spinner deleted the docs-pep612 branch January 2, 2021 09:09
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Fidget-Spinner@gvanrossum@the-knights-who-say-ni@bedevere-bot