Skip to content

Commit 8167dfd

Browse files
author
James Souter
committed
Use typing.Any for ca transport utils
1 parent a9a4476 commit 8167dfd

File tree

1 file changed

+4
-3
lines changed
  • src/fastcs/transport/epics/ca

1 file changed

+4
-3
lines changed

src/fastcs/transport/epics/ca/util.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from dataclasses import asdict
2+
from typing import Any
23

34
from softioc import builder
45

@@ -44,10 +45,10 @@
4445

4546
def record_metadata_from_attribute(
4647
attribute: Attribute[T],
47-
) -> dict[str, str | object | None]:
48+
) -> dict[str, Any]:
4849
"""Converts attributes on the `Attribute` to the
4950
field name/value in the record metadata."""
50-
metadata: dict[str, str | object | None] = {"DESC": attribute.description}
51+
metadata: dict[str, Any] = {"DESC": attribute.description}
5152
initial = None
5253
match attribute:
5354
case AttrR():
@@ -125,7 +126,7 @@ def cast_from_epics_type(datatype: DataType[T], value: object) -> T:
125126
raise ValueError(f"Unsupported datatype {datatype}")
126127

127128

128-
def cast_to_epics_type(datatype: DataType[T], value: T) -> object:
129+
def cast_to_epics_type(datatype: DataType[T], value: T) -> Any:
129130
"""Casts from an attribute's datatype to an EPICS datatype."""
130131
match datatype:
131132
case Enum():

0 commit comments

Comments
 (0)