Skip to content
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

PEP 646 (Variadic Generics) tracker #8708

Closed
3 of 5 tasks
srittau opened this issue Sep 8, 2022 · 4 comments
Closed
3 of 5 tasks

PEP 646 (Variadic Generics) tracker #8708

srittau opened this issue Sep 8, 2022 · 4 comments
Labels
project: feature tracker Tracks whether a typing feature can be used in typeshed stubs

Comments

@srittau
Copy link
Collaborator

srittau commented Sep 8, 2022

@srittau srittau added the project: feature tracker Tracks whether a typing feature can be used in typeshed stubs label Sep 8, 2022
@AlexWaygood
Copy link
Member

AlexWaygood commented Sep 9, 2022

I've ticked off pyright; I believe it's supported PEP 646 for a while now. I've also added a link to the nominal mypy issue, though there have been a fair few PRs over at mypy working on PEP 646 support and none of them seem to have referenced that issue ¯\_(ツ)_/¯.

@AlexWaygood
Copy link
Member

PEP 646 lists Pyre as providing a reference implementation of the PEP, so they probably also have pretty good support.

@AlexWaygood
Copy link
Member

PEP 646 support would be useful for (feel free to edit this):

  • asyncio.events.Handle
  • asyncio.events.TimerHandle
  • asyncio.events.AbstractEventLoop.call_at
  • asyncio.events.AbstractEventLoop.call_later
  • asyncio.events.AbstractEventLoop.call_soon
  • asyncio.base_events.BaseEventLoop.call_at
  • asyncio.base_events.BaseEventLoop.call_later
  • asyncio.base_events.BaseEventLoop.call_soon
  • (Maybe): functools.partial (functools.partial should use PEP612 ParamSpec (depends on #8708) #8703)
  • Various functions in the keyboard third-party stubs:
    • def on_button(
      callback: Callable[..., None],
      args: _Ts = ...,
      buttons: list[_MouseButton] | tuple[_MouseButton, ...] | _MouseButton = ...,
      types: list[_MouseEventType] | tuple[_MouseEventType, ...] | _MouseEventType = ...,
      ) -> _Callback: ...
      def on_click(callback: Callable[..., None], args: _Ts = ...) -> _Callback: ...
      def on_double_click(callback: Callable[..., None], args: _Ts = ...) -> _Callback: ...
      def on_right_click(callback: Callable[..., None], args: _Ts = ...) -> _Callback: ...
      def on_middle_click(callback: Callable[..., None], args: _Ts = ...) -> _Callback: ...
    • def call_later(fn: Callable[..., None], args: _Ts = ..., delay: float = ...) -> None: ...
    • def add_hotkey(
      hotkey: _ParseableHotkey,
      callback: Callable[..., bool | None],
      args: _Ts = ...,
      suppress: bool = ...,
      timeout: float = ...,
      trigger_on_release: bool = ...,
      ) -> Callable[[], None]: ...

Note that we won't be able to use PEP 646 as it currently stands for builtins.map, builtins.zip or asyncio.gather: python/cpython#32103 (comment)

@srittau
Copy link
Collaborator Author

srittau commented Dec 11, 2023

This is now used in several places.

@srittau srittau closed this as completed Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project: feature tracker Tracks whether a typing feature can be used in typeshed stubs
Projects
None yet
Development

No branches or pull requests

2 participants