Skip to content

Commit 131a09b

Browse files
author
Tim Joseph
committed
fix(types): define EllipsisType for Python 3.9 compatibility
The `types.EllipsisType` was introduced in Python 3.10. This change ensures that `EllipsisType` is correctly defined and available when running on Python 3.9 environments, preventing import errors.
1 parent 5d4eed9 commit 131a09b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tensorcontainer/types.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
"""
88

99
from typing import List, Union
10-
from types import EllipsisType
1110
import torch
1211

12+
# Define EllipsisType for Python 3.9 compatibility
13+
EllipsisType = type(...)
14+
1315
# Mirror torch._prims_common.ShapeType without importing it directly.
1416
ShapeLike = Union[torch.Size, list[int], tuple[int, ...]]
1517

0 commit comments

Comments
 (0)