Update Optional[x] -> x | None and Union[x, y] to x | y (#26633)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2025-10-12 17:51:31 +01:00
committed by GitHub
parent 9bb38130cb
commit 8fcaaf6a16
944 changed files with 9490 additions and 10121 deletions

View File

@@ -3,7 +3,8 @@
import asyncio
import os
from typing import Any, Callable, Optional, Union
from collections.abc import Callable
from typing import Any
import pytest
@@ -20,12 +21,12 @@ class Mock: ...
class CustomMultiprocExecutor(MultiprocExecutor):
def collective_rpc(
self,
method: Union[str, Callable],
timeout: Optional[float] = None,
method: str | Callable,
timeout: float | None = None,
args: tuple = (),
kwargs: Optional[dict] = None,
kwargs: dict | None = None,
non_block: bool = False,
unique_reply_rank: Optional[int] = None,
unique_reply_rank: int | None = None,
) -> list[Any]:
# Drop marker to show that this was run
with open(".marker", "w"):