From f7f2d1247baa4f4c623d1e59d7ed00f37eb7f890 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 21 Mar 2023 22:33:54 -0400 Subject: [PATCH] Drop more `Optional` usage on our `Struct` --- piker/data/types.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/piker/data/types.py b/piker/data/types.py index c37de233..7a3bc6bb 100644 --- a/piker/data/types.py +++ b/piker/data/types.py @@ -19,7 +19,6 @@ Built-in (extension) types. """ import sys -from typing import Optional from pprint import pformat import msgspec @@ -59,7 +58,7 @@ class Struct( def copy( self, - update: Optional[dict] = None, + update: dict | None = None, ) -> msgspec.Struct: ''' @@ -84,7 +83,7 @@ class Struct( # use ``.copy()`` above in such cases. def typecast( self, - # fields: Optional[list[str]] = None, + # fields: list[str] | None = None, ) -> None: for fname, ftype in self.__annotations__.items(): setattr(self, fname, ftype(getattr(self, fname)))