Skip to content

SimpleUDPClient.send_message -> Type of parameter "value" is partially unknown #171

Open
@BlackDereker

Description

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:

  1. Change the type annotation for value to a union:

    def send_message(self, address: str, value: Union[ArgValue, List[ArgValue]]) -> None:
  2. 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 value parameter.
  • It would also ensure consistent behavior, regardless of whether a single argument or a list of arguments is provided.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions