Skip to content

Commit

Permalink
from typing import Optional
Browse files Browse the repository at this point in the history
I never thought `Optional` is imported from `baseutils`, this does not
feel great to me.

Signed-off-by: Masaki Kozuki <mkozuki@nvidia.com>
  • Loading branch information
crcrpar committed Nov 11, 2024
1 parent 93dd4e7 commit bbcb068
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions thunder/core/codeutils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from types import CodeType, FunctionType, MethodType, EllipsisType
from typing import List, Dict, Tuple, Set, Deque, Any, NamedTuple
from typing import List, Dict, Tuple, Set, Deque, Any, NamedTuple, Optional
from numbers import Number
from collections import deque
from collections.abc import Mapping, Sequence, Iterable
Expand Down Expand Up @@ -105,7 +105,7 @@ def is_literal(x: Any) -> bool:
return True


def _to_printable(tracectx: Optional, x: Any) -> tuple[Any, Optional[tuple[str, Any]]]:
def _to_printable(tracectx: Optional, x: Any) -> tuple[Any, tuple[str, Any] | None]:
can_print, module_info = is_printable(x)
if can_print:
return x, module_info
Expand All @@ -125,8 +125,8 @@ def to_printable(
trace: Optional,
x: Any,
*,
import_ctx: Optional[dict] = None,
object_ctx: Optional[dict] = None,
import_ctx: dict | None = None,
object_ctx: dict | None = None,
) -> Printable:
# Short-circuits if x is a Proxy
if isinstance(x, ProxyInterface):
Expand Down

0 comments on commit bbcb068

Please sign in to comment.