[Misc] Replace Optional[X] with X | None syntax (#33332)

Signed-off-by: carlory <baofa.fan@daocloud.io>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
杨朱 · Kiki
2026-01-30 01:56:59 -08:00
committed by GitHub
co-authored by Claude Opus 4.5
parent c87eac18f7
commit 1a7894dbdf
56 changed files with 129 additions and 135 deletions
+1 -2
View File
@@ -1,7 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import threading
from typing import Optional
import torch
@@ -15,7 +14,7 @@ logger = init_logger(__name__)
_THREAD_ID_TO_CONTEXT: dict = {}
# Here we hardcode the number of microbatches to 2 for default.
_NUM_UBATCHES: int = 2
_CURRENT_CONTEXTS: list[Optional["UBatchContext"]] = []
_CURRENT_CONTEXTS: list["UBatchContext | None"] = []
class UBatchContext:
+1 -2
View File
@@ -5,7 +5,6 @@ import inspect
import os
from itertools import accumulate
from math import prod
from typing import Optional
import torch
@@ -26,7 +25,7 @@ _MB = 1024**2
_GiB = 1024**3
# Global workspace manager instance
_manager: Optional["WorkspaceManager"] = None
_manager: "WorkspaceManager | None" = None
class WorkspaceManager: