Is this is a valid use of ParamSpec
?
#2727
Answered
by
RobertCraigie
RobertCraigie
asked this question in
Q&A
-
from typing_extensions import ParamSpec
from typing import Dict, Generic, Optional
P = ParamSpec('P')
class HTTP:
def __init__(self, headers: Optional[Dict[str, str]] = None) -> None:
...
class _Base(Generic[P]):
def __init__(self, foo: str, *args: P.args, **kwargs: P.kwargs) -> None:
...
Base = _Base[HTTP]
class Sub(Base):
def __init__(self) -> None:
super().__init__(foo='foo', headers={'foo': 'bar'}) Pyright complains:
|
Beta Was this translation helpful? Give feedback.
Answered by
RobertCraigie
Dec 17, 2021
Replies: 1 comment
-
Found out that it is not: #2667 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
RobertCraigie
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found out that it is not: #2667