@@ -976,14 +976,14 @@ def test_iterator_annotations(doc):
976976def test_fn_annotations (doc ):
977977 assert (
978978 doc (m .annotate_fn )
979- == "annotate_fn(arg0: collections.abc.Callable[[list[str], str], int ]) -> None"
979+ == "annotate_fn(arg0: collections.abc.Callable[[list[str], str], typing.SupportsInt | typing.SupportsIndex ]) -> None"
980980 )
981981
982982
983983def test_fn_return_only (doc ):
984984 assert (
985985 doc (m .annotate_fn_only_return )
986- == "annotate_fn_only_return(arg0: collections.abc.Callable[..., int ]) -> None"
986+ == "annotate_fn_only_return(arg0: collections.abc.Callable[..., typing.SupportsInt | typing.SupportsIndex ]) -> None"
987987 )
988988
989989
@@ -1085,7 +1085,7 @@ def test_literal(doc):
10851085 )
10861086 assert (
10871087 doc (m .identity_literal_arrow_with_callable )
1088- == 'identity_literal_arrow_with_callable(arg0: collections.abc.Callable[[typing.Literal["->"], float | int ], float]) -> collections.abc.Callable[[typing.Literal["->"], float | int], float]'
1088+ == 'identity_literal_arrow_with_callable(arg0: collections.abc.Callable[[typing.Literal["->"], float], float | int ]) -> collections.abc.Callable[[typing.Literal["->"], float | int], float]'
10891089 )
10901090 assert (
10911091 doc (m .identity_literal_all_special_chars )
@@ -1325,27 +1325,27 @@ def test_arg_return_type_hints(doc, backport_typehints):
13251325 # Callable<R(A)> identity
13261326 assert (
13271327 doc (m .identity_callable )
1328- == "identity_callable(arg0: collections.abc.Callable[[float | int ], float]) -> collections.abc.Callable[[float | int], float]"
1328+ == "identity_callable(arg0: collections.abc.Callable[[float], float | int ]) -> collections.abc.Callable[[float | int], float]"
13291329 )
13301330 # Callable<R(...)> identity
13311331 assert (
13321332 doc (m .identity_callable_ellipsis )
1333- == "identity_callable_ellipsis(arg0: collections.abc.Callable[..., float]) -> collections.abc.Callable[..., float]"
1333+ == "identity_callable_ellipsis(arg0: collections.abc.Callable[..., float | int ]) -> collections.abc.Callable[..., float]"
13341334 )
13351335 # Nested Callable<R(A)> identity
13361336 assert (
13371337 doc (m .identity_nested_callable )
1338- == "identity_nested_callable(arg0: collections.abc.Callable[[collections.abc.Callable[[float | int], float]], collections.abc.Callable[[float | int], float]] ) -> collections.abc.Callable[[collections.abc.Callable[[float | int ], float]], collections.abc.Callable[[float | int], float]]"
1338+ == "identity_nested_callable(arg0: collections.abc.Callable[[collections.abc.Callable[[float | int], float]], collections.abc.Callable[[float], float | int]] ) -> collections.abc.Callable[[collections.abc.Callable[[float], float | int ]], collections.abc.Callable[[float | int], float]]"
13391339 )
13401340 # Callable<R(A)>
13411341 assert (
13421342 doc (m .apply_callable )
1343- == "apply_callable(arg0: float | int, arg1: collections.abc.Callable[[float | int ], float]) -> float"
1343+ == "apply_callable(arg0: float | int, arg1: collections.abc.Callable[[float], float | int ]) -> float"
13441344 )
13451345 # Callable<R(...)>
13461346 assert (
13471347 doc (m .apply_callable_ellipsis )
1348- == "apply_callable_ellipsis(arg0: float | int, arg1: collections.abc.Callable[..., float]) -> float"
1348+ == "apply_callable_ellipsis(arg0: float | int, arg1: collections.abc.Callable[..., float | int ]) -> float"
13491349 )
13501350 # Union<T1, T2>
13511351 assert (
0 commit comments