Skip to content

Commit

Permalink
Add String datatype
Browse files Browse the repository at this point in the history
  • Loading branch information
GDYendell committed Sep 29, 2023
1 parent 00f04e1 commit fa735a0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/fastcs/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from dataclasses import dataclass
from typing import Awaitable, Callable, Generic, TypeVar

T = TypeVar("T", int, float, bool)
T = TypeVar("T", int, float, bool, str)
ATTRIBUTE_TYPES: tuple[type] = T.__constraints__ # type: ignore


Expand Down Expand Up @@ -42,3 +42,10 @@ class Bool(DataType[bool]):
@property
def dtype(self) -> type[bool]:
return bool


@dataclass(frozen=True)
class String(DataType[str]):
@property
def dtype(self) -> type[str]:
return str

0 comments on commit fa735a0

Please sign in to comment.