Skip to content

Clarify our intent to support PEP 646 Unpack in type checking, not just grammar#2198

Merged
gvanrossum merged 4 commits intopython:mainfrom
stroxler:clarify-pep677-pep646
Dec 18, 2021
Merged

Clarify our intent to support PEP 646 Unpack in type checking, not just grammar#2198
gvanrossum merged 4 commits intopython:mainfrom
stroxler:clarify-pep677-pep646

Conversation

@stroxler
Copy link
Copy Markdown
Contributor

@stroxler stroxler commented Dec 17, 2021

Thanks to Eric Traut for pointing out that we should be clearer
about our intent here and not just give a grammar snippet.

Thanks to Eric Traut for pointing out that we should specifically
address supporting Unpack and the statics, as well as the
grammar changes that we will need.
@gvanrossum
Copy link
Copy Markdown
Member

Whoa. Let's wait merging this until we're done discussing the need to support Unpack[Ts] (see my post to typing-sig).

Also, what does "the statics" refer to?

(I do agree that it's nice to show the syntax changes needed for PEP 646.)

Leave in the discussion of how `(int, *Ts) -> bool` is equivalent
to various Callable constructions, but remove the requirement
to support an explicit `Unpack[Ts]`.

Supporting `Unpack` in new syntax shouldn't be necessary
since the new callable syntax will ship with support for the
new star syntax, so there's no need for having a solution on
earlier python versions.
@stroxler stroxler changed the title Clarify our intent to support PEP 646 Unpack, and intended statics Clarify our intent to support PEP 646 Unpack in type checking, not just grammar Dec 18, 2021
@stroxler
Copy link
Copy Markdown
Contributor Author

By "the statics" I meant the expected behavior of type checkers (that is, the semantics for correct static analysis).

I changed the wording to make that clearer, and took out the part about expecting type checkers to support Unpack[Ts] in arguments, which I agree probably isn't really needed.

Copy link
Copy Markdown
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

One duplicate word. I'll just apply that fix and then land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants