Skip to content

Commit 17b46d6

Browse files
[nfc] Remove/redirect some typing imports introduced in Python 3.11.
1 parent 86653a4 commit 17b46d6

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

python/shark_turbine/kernel/_support/regions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
TypeVar,
44
Callable,
55
Type,
6-
assert_type,
76
cast,
87
List,
98
Dict,

python/shark_turbine/kernel/_support/tracing.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
TypeVar,
55
Callable,
66
Type,
7-
assert_type,
87
cast,
98
List,
109
Dict,
@@ -42,6 +41,14 @@
4241

4342
from . import context
4443

44+
try:
45+
from typing import assert_type
46+
except ImportError:
47+
# No-op if not supported. Introduced in Python 3.11.
48+
def assert_type(a, b):
49+
pass
50+
51+
4552
TCallable = TypeVar("TCallable", bound=Callable)
4653

4754
###############################################################################

python/shark_turbine/kernel/gen/thread.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
TypeVar,
66
Callable,
77
Union,
8-
assert_type,
98
cast,
109
Any,
1110
)

python/shark_turbine/kernel/lang/prims.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from typing import assert_type
2-
31
from .. import ops
42

53
from .._support.tracing import (

python/shark_turbine/kernel/ops/control_flow.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
overload,
88
Callable,
99
Tuple,
10-
Unpack,
1110
)
1211
import typing
1312

python/shark_turbine/kernel/ops/memory.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
overload,
88
Callable,
99
Tuple,
10-
Unpack,
1110
)
1211
import typing
1312

0 commit comments

Comments
 (0)