Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BlackDereker opened this issue Feb 15, 2024 · 0 comments

Comments

@BlackDereker
Copy link

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant