more fixes and improvements

This commit is contained in:
Jan Petykiewicz 2023-01-25 23:19:25 -08:00 • committed by jan
commit 5452bc5608
2 changed files with 78 additions and 31 deletions

View file

@ -1,7 +1,7 @@
"""
Various helper functions, type definitions, etc.
"""
from .types import layer_t, annotations_t
from .types import layer_t, annotations_t, SupportsBool
from .array import is_scalar
from .autoslots import AutoSlots

View file

@ -1,8 +1,13 @@
"""
Type definitions
"""
from typing import Union, Tuple, Dict, List
from typing import Union, Tuple, Dict, List, Protocol
layer_t = Union[int, Tuple[int, int], str]
annotations_t = Dict[str, List[Union[int, float, str]]]
class SupportsBool(Protocol):
def __bool__(self) -> bool:
...