1. ParamSpec -> TypeVar for ``typing.Concatenate``
2. ParamSpec's call signature should align with its documentation.
Noticed in GH-24169
from collections.abc import Callable
from threading import Lock
- from typing import Any, Concatenate, ParamSpec
+ from typing import Any, Concatenate, ParamSpec, TypeVar
P = ParamSpec('P')
- R = ParamSpec('R')
+ R = TypeVar('R')
# Use this lock to ensure that only one thread is executing a function
# at any time.
args = object()
kwargs = object()
- def __init__(self, name, bound=None, covariant=False, contravariant=False):
+ def __init__(self, name, *, bound=None, covariant=False, contravariant=False):
self.__name__ = name
super().__init__(bound, covariant, contravariant)
try: