Skip to content

Commit

Permalink
Support older Python
Browse files Browse the repository at this point in the history
Inherit from `Generic[...]`
  • Loading branch information
uellue committed Sep 13, 2024
1 parent bc124a7 commit a0596df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libertem_schema/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, Sequence, Callable
import functools

from typing_extensions import TypeVar
from typing_extensions import TypeVar, Generic

import numpydantic
import numpy as np
Expand Down Expand Up @@ -66,7 +66,7 @@ def _make_type(reference: pint.Quantity):
DType = TypeVar('DType')
Shape = TypeVar('Shape')

class Single[DType](pint.Quantity):
class Single(pint.Quantity, Generic[DType]):
@classmethod
def __get_pydantic_core_schema__(
cls,
Expand Down Expand Up @@ -115,7 +115,7 @@ def validator(v: Any, info: ValidationInfo) -> pint.Quantity:
),
)

class Array[Shape, DType](pint.Quantity):
class Array(pint.Quantity, Generic[Shape, DType]):
@classmethod
def __get_pydantic_core_schema__(
cls,
Expand Down

0 comments on commit a0596df

Please sign in to comment.