Skip to content

Commit 072a3ac

Browse files
committed
Use object in the to_any() and from_any() signatures
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
1 parent 6ff26ea commit 072a3ac

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/nipanel/_converters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def to_python_value(self, protobuf_value: wrappers_pb2.StringValue) -> str:
181181
_SUPPORTED_PYTHON_TYPES = _CONVERTER_FOR_PYTHON_TYPE.keys()
182182

183183

184-
def to_any(python_value: Any) -> any_pb2.Any:
184+
def to_any(python_value: object) -> any_pb2.Any:
185185
"""Convert a Python object to a protobuf Any."""
186186
underlying_parents = type(python_value).mro() # This covers enum.IntEnum and similar
187187

@@ -198,7 +198,7 @@ def to_any(python_value: Any) -> any_pb2.Any:
198198
return converter.to_protobuf_any(python_value)
199199

200200

201-
def from_any(protobuf_any: any_pb2.Any) -> Any:
201+
def from_any(protobuf_any: any_pb2.Any) -> object:
202202
"""Convert a protobuf Any to a Python object."""
203203
if not isinstance(protobuf_any, any_pb2.Any):
204204
raise ValueError(f"Unexpected type: {type(protobuf_any)}")

0 commit comments

Comments
 (0)