Skip to content

Conversation

@janiversen
Copy link
Collaborator

@janiversen janiversen commented Nov 24, 2024

Typing in python is really BAD !!

every developer would read this:

   values: list[int] | list[bytes]

as values can be either list[int] OR list[bytes], but mypy is stupid and requires values to be "list[int] | list[bytes]"

Using:

   values: Sequence[int | bytes]

solves this problem, but do NOT allow the array to be changed.

As a consequence of this, the API from now on only accept list[int], which are NOT modified !!

If an app wants to use bytes, it must be converted to int before calling. The API contains different from/to register conversions that can help if needed.

@janiversen janiversen merged commit 651bd61 into dev Nov 24, 2024
1 check passed
@janiversen janiversen deleted the list branch November 24, 2024 15:36
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

Successfully merging this pull request may close these issues.

2 participants