You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following up on this, running mypy 0.910 and typing-extensions 3.10.0.2, I get errors with the documentation example for ParamSpec:
importloggingfromcollections.abcimportCallablefromtypingimportTypeVarfromtyping_extensionsimportParamSpecT=TypeVar('T')
P=ParamSpec('P')
defadd_logging(f: Callable[P, T]) ->Callable[P, T]:
# mypy complains for the above line:# The first argument to Callable must be a list of types or "..."definner(*args: P.args, **kwargs: P.kwargs) ->T:
# mypy complains for the above line:# Name "P.args" is not defined# Name "P.kwargs" is not definedlogging.info(f'{f.__name__} was called')
returnf(*args, **kwargs)
returninner
Is it not possible to use ParamSpec in python 3.9?
Activity
JelleZijlstra commentedon Apr 4, 2021
There is an open pull request: #774.
markedwards commentedon Apr 4, 2021
Thanks for the pointer @JelleZijlstra
gvanrossum commentedon Apr 5, 2021
JelleZijlstra commentedon Apr 5, 2021
I will, I can ping you once I'm happy with it.
JelleZijlstra commentedon Apr 11, 2021
This has now been merged.
markedwards commentedon Apr 11, 2021
Thanks!
markedwards commentedon Oct 23, 2021
Following up on this, running mypy 0.910 and typing-extensions 3.10.0.2, I get errors with the documentation example for ParamSpec:
Is it not possible to use ParamSpec in python 3.9?
srittau commentedon Oct 23, 2021
mypy 0.910 doesn't support ParamSpec yet.
markedwards commentedon Oct 23, 2021
@srittau Thanks, I see python/mypy#8645 now