From 2b36c453e8ddacdfc2769997868456f6d38624fc Mon Sep 17 00:00:00 2001 From: Brian Schubert Date: Mon, 23 Feb 2026 12:06:19 -0500 Subject: [PATCH] [types] Make `UnionType.__getitem__` parameter positional-only (#15458) --- stdlib/types.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 568f6ea68..e26c9447d 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -733,7 +733,7 @@ if sys.version_info >= (3, 10): def __hash__(self) -> int: ... # you can only subscript a `UnionType` instance if at least one of the elements # in the union is a generic alias instance that has a non-empty `__parameters__` - def __getitem__(self, parameters: Any) -> object: ... + def __getitem__(self, parameters: Any, /) -> object: ... if sys.version_info >= (3, 13): @final