-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Handle NumPy types #48
Comments
Since version 1.9.0, NumPy integers are subclasses of |
I think |
We would need to replace |
That doesn't look safe to me. We will need to add Seems relevant - python/typing#272. |
But maybe we should support NumPy numbers as they are quite common. We could keep a stricter type on the attributes but add |
One can very easily introduce NumPy numbers without realizing it. The way I found out about this was when I called One way would be to use Why exactly does MIDI output require Python |
Actually, duck typing is the principle and type checking is optional. And, for this reason, I think we should keep type annotations as strict as it can be. Some possible solutions:
I guess so. I remembered either |
Good point about the serialization... Then I guess the safest thing to do would be to make sure that For example, looking at |
The
Also, the |
MusPy currently doesn't consider NumPy types to be valid:
The text was updated successfully, but these errors were encountered: