Skip to content

How to use ParamSpec #1763

Answered by erictraut
charmoniumQ asked this question in Q&A
Apr 15, 2021 · 1 comments · 6 replies
Discussion options

You must be logged in to vote

PEP 612 support (including support for ParamSpec and Concatenate) have been added to the typing_extensions library, but a new version of typing_extensions has not yet been published to pypi. See this issue for details.

Here are a couple of alternative suggestions:

  1. You could wait until the new typing_extensions library is published and upgrade to it. Feel free to file a request in that repo to ask the maintainers to publish sooner rather than later. :)
  2. If you want a solution sooner, here's a variation on your code that should work at runtime.
from __future__ import annotations
from typing import TYPE_CHECKING, Generic, TypeVar, Callable, Any

if TYPE_CHECKING:
    from typing_extensions i…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@erictraut
Comment options

@charmoniumQ
Comment options

@charmoniumQ
Comment options

@charmoniumQ
Comment options

@erictraut
Comment options

Answer selected by charmoniumQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants