Skip to content

Commit 1151549

Browse files
committed
fix typevar syntax
1 parent 0a3669d commit 1151549

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
build:
33
os: ubuntu-24.04
44
tools:
5-
python: "3.12"
5+
python: "3.13"
66
python:
77
install:
88
- method: pip

src/testing/fast_array_utils/_array_type.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,17 @@ class ConversionContext:
7474
hdf5_file: h5py.File # TODO(flying-sheep): ReadOnly <https://peps.python.org/pep-0767/>
7575

7676

77-
if sys.version_info < (3, 13):
78-
pass # TODO(flying-sheep): move vars into type parameter syntax # noqa: TD003
79-
Arr = TypeVar("Arr", bound="ExtendedArray", default="Array")
80-
Inner = TypeVar("Inner", bound="ArrayType[InnerArray, None] | None", default="Any")
77+
if sys.version_info >= (3, 13):
78+
# TODO(flying-sheep): move vars into type parameter syntax # noqa: TD003
79+
Arr = TypeVar("Arr", bound="ExtendedArray", default="Array")
80+
Inner = TypeVar("Inner", bound="ArrayType[InnerArray, None] | None", default="Any")
81+
else:
82+
Arr = TypeVar("Arr")
83+
Inner = TypeVar("Inner")
8184

8285

8386
@dataclass(frozen=True)
84-
class ArrayType(Generic[Arr, Inner]):
87+
class ArrayType(Generic[Arr, Inner]): # noqa: UP046
8588
"""Supported array type with methods for conversion and random generation.
8689
8790
Examples

0 commit comments

Comments
 (0)