python-osc
python-osc copied to clipboard
SimpleUDPClient.send_message -> Type of parameter "value" is partially unknown
The send_message method within the SimpleUDPClient class currently expects a value parameter of type ArgValue. However, the internal logic handles it as both a single argument and a list of arguments, leading to potential confusion and inconsistencies.
Proposed Improvement:
-
Change the type annotation for
valueto a union:def send_message(self, address: str, value: Union[ArgValue, List[ArgValue]]) -> None: -
Simplify the ArgValue:
ArgValue = Union[str, bytes, bool, int, float, osc_types.MidiPacket]
Additional Notes:
- This change would enhance code clarity and maintainability by explicitly expressing the intended usage of the
valueparameter. - It would also ensure consistent behavior, regardless of whether a single argument or a list of arguments is provided.