-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Open
Labels
Description
Documentation
*Notes:
- Python 3.14.3
infer_variance parameter is implemented for typing.ParamSpec according to the source code as shown below:
...
if sys.version_info >= (3, 13):
def __new__(
cls,
name: str,
*,
bound: Any | None = None, # AnnotationForm
contravariant: bool = False,
covariant: bool = False,
infer_variance: bool = False, # <- Here
default: Any = ..., # AnnotationForm
) -> Self: ...
...And, Python interpreter doesn't give error for ParamSpec with infer_variance parameter as shown below:
# ↓ ↓ No error ↓ ↓
P = ParamSpec('P', infer_variance=True)So, the docs should also say infer_variance parameter with typing.ParamSpec explanation as shown below:
class typing.ParamSpec(name, *, bound=None, covariant=False, contravariant=False, infer_variance=False, default=typing.NoDefault)
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Projects
Status
Todo