mirror of
https://github.com/tiqi-group/pydase.git
synced 2026-02-14 14:28:40 +01:00
fixes mypy error
This commit is contained in:
@@ -66,12 +66,14 @@ class Serializer:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _serialize_enum(obj: Enum) -> dict[str, Any]:
|
def _serialize_enum(obj: Enum) -> dict[str, Any]:
|
||||||
|
import pydase.components.coloured_enum
|
||||||
|
|
||||||
value = obj.name
|
value = obj.name
|
||||||
readonly = False
|
readonly = False
|
||||||
doc = obj.__doc__
|
doc = obj.__doc__
|
||||||
if sys.version_info < (3, 11) and doc == "An enumeration.":
|
if sys.version_info < (3, 11) and doc == "An enumeration.":
|
||||||
doc = None
|
doc = None
|
||||||
if type(obj).__base__.__name__ == "ColouredEnum":
|
if isinstance(obj, pydase.components.coloured_enum.ColouredEnum):
|
||||||
obj_type = "ColouredEnum"
|
obj_type = "ColouredEnum"
|
||||||
else:
|
else:
|
||||||
obj_type = "Enum"
|
obj_type = "Enum"
|
||||||
|
|||||||
Reference in New Issue
Block a user