Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ace008c

Browse files
Fix various ParamSpec errors in typing (GH-24176)
1. ParamSpec -> TypeVar for ``typing.Concatenate`` 2. ParamSpec's call signature should align with its documentation. Noticed in GH-24169
1 parent 81f87bb commit ace008c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Doc/library/typing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,10 @@ These can be used as types in annotations using ``[]``, each having a unique syn
695695

696696
from collections.abc import Callable
697697
from threading import Lock
698-
from typing import Any, Concatenate, ParamSpec
698+
from typing import Any, Concatenate, ParamSpec, TypeVar
699699

700700
P = ParamSpec('P')
701-
R = ParamSpec('R')
701+
R = TypeVar('R')
702702

703703
# Use this lock to ensure that only one thread is executing a function
704704
# at any time.

Lib/typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ def add_two(x: float, y: float) -> float:
779779
args = object()
780780
kwargs = object()
781781

782-
def __init__(self, name, bound=None, covariant=False, contravariant=False):
782+
def __init__(self, name, *, bound=None, covariant=False, contravariant=False):
783783
self.__name__ = name
784784
super().__init__(bound, covariant, contravariant)
785785
try:

0 commit comments

Comments
 (0)