diff --git a/pytools/__init__.py b/pytools/__init__.py index 0bbcf44e..09e1eacd 100644 --- a/pytools/__init__.py +++ b/pytools/__init__.py @@ -1144,7 +1144,7 @@ def set_sum(set_iterable): return reduce(or_, set_iterable, set()) -def div_ceil(nr, dr): +def div_ceil(nr: int, dr: int): return -(-nr // dr) diff --git a/pytools/obj_array.py b/pytools/obj_array.py index 9dc188ff..75382a86 100644 --- a/pytools/obj_array.py +++ b/pytools/obj_array.py @@ -152,6 +152,9 @@ def __len__(self) -> int: ... @property def size(self) -> int: ... + @property + def T(self) -> Self: ... # noqa: N802 + @overload def __getitem__(self, x: ShapeT, /) -> T: ...