Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions stdlib/@tests/stubtest_allowlists/py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,9 @@ typing\.Annotated # Super-special typing primitive
# These methods have no default implementation for Python < 3.13.
_pickle.Pickler.persistent_id
_pickle.Unpickler.persistent_load

# `name` is a positional string literal for these special forms (PEP 484 / 612);
# the stub marks it positional-only, but the pure-Python 3.10 runtime objects
# accept it as a keyword argument.
typing.ParamSpec.__init__
typing.TypeVar.__init__
5 changes: 5 additions & 0 deletions stdlib/@tests/stubtest_allowlists/py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,8 @@ typing\.Annotated # Super-special typing primitive
# These methods have no default implementation for Python < 3.13.
_pickle.Pickler.persistent_id
_pickle.Unpickler.persistent_load

# `name` is a positional string literal for TypeVarTuple (PEP 646); the stub
# marks it positional-only, but the pure-Python 3.11 runtime __init__ accepts
# it as a keyword argument.
typing.TypeVarTuple.__init__
23 changes: 18 additions & 5 deletions stdlib/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ class TypeVar:
def __new__(
cls,
name: str,
/,
*constraints: Any, # AnnotationForm
bound: Any | None = None, # AnnotationForm
contravariant: bool = False,
Expand All @@ -189,6 +190,7 @@ class TypeVar:
def __new__(
cls,
name: str,
/,
*constraints: Any, # AnnotationForm
bound: Any | None = None, # AnnotationForm
covariant: bool = False,
Expand All @@ -199,6 +201,7 @@ class TypeVar:
def __new__(
cls,
name: str,
/,
*constraints: Any, # AnnotationForm
bound: Any | None = None, # AnnotationForm
covariant: bool = False,
Expand All @@ -208,6 +211,7 @@ class TypeVar:
def __init__(
self,
name: str,
/,
*constraints: Any, # AnnotationForm
bound: Any | None = None, # AnnotationForm
covariant: bool = False,
Expand Down Expand Up @@ -280,6 +284,7 @@ if sys.version_info >= (3, 11):
def __new__(
cls,
name: str,
/,
*,
bound: Any | None = None, # AnnotationForm
covariant: bool = False,
Expand All @@ -288,11 +293,11 @@ if sys.version_info >= (3, 11):
infer_variance: bool = False,
) -> Self: ...
elif sys.version_info >= (3, 13):
def __new__(cls, name: str, *, default: Any = ...) -> Self: ... # AnnotationForm
def __new__(cls, name: str, /, *, default: Any = ...) -> Self: ... # AnnotationForm
elif sys.version_info >= (3, 12):
def __new__(cls, name: str) -> Self: ...
def __new__(cls, name: str, /) -> Self: ...
else:
def __init__(self, name: str) -> None: ...
def __init__(self, name: str, /) -> None: ...

def __iter__(self) -> Any: ...
def __typing_subst__(self, arg: Never, /) -> Never: ...
Expand Down Expand Up @@ -345,6 +350,7 @@ class ParamSpec:
def __new__(
cls,
name: str,
/,
*,
bound: Any | None = None, # AnnotationForm
contravariant: bool = False,
Expand All @@ -356,6 +362,7 @@ class ParamSpec:
def __new__(
cls,
name: str,
/,
*,
bound: Any | None = None, # AnnotationForm
contravariant: bool = False,
Expand All @@ -364,11 +371,17 @@ class ParamSpec:
) -> Self: ...
elif sys.version_info >= (3, 11):
def __new__(
cls, name: str, *, bound: Any | None = None, contravariant: bool = False, covariant: bool = False # AnnotationForm
cls, name: str, /, *, bound: Any | None = None, contravariant: bool = False, covariant: bool = False # AnnotationForm
) -> Self: ...
else:
def __init__(
self, name: str, *, bound: Any | None = None, contravariant: bool = False, covariant: bool = False # AnnotationForm
self,
name: str,
/,
*,
bound: Any | None = None,
contravariant: bool = False,
covariant: bool = False, # AnnotationForm
) -> None: ...

@property
Expand Down
Loading