You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The recv_json method of the zmq.Serial class has its return type listed as: list | str | int | float | dict. list and dict require generic arguments for this return type to be complete. As is, users of this class cannot fully benefit from static analysis.
The text was updated successfully, but these errors were encountered:
Yeah, it could be more detailed to specify everything that JSON might be, but what's there now should at least be fully correct, if slightly more expansive than necessary. What problem do you see?
When using this function in a project that adheres to strict type checking (at least for pyright, I'm not sure about mypy), code that uses this function carries around an Unknown type. Thus, any code that's using it gets hit with:
Type of "req" is partially unknown
Type of "req" is "list[Unknown] | str | int | float | dict[Unknown, Unknown]"
For a json type, something like the following would make static analysis on zmq code more robust.
Of course, this can be done in custom stub files for the library on a per-project basis where needed, but its nice to not need to maintain stubs when possible.
The
recv_json
method of the zmq.Serial class has its return type listed as:list | str | int | float | dict
.list
anddict
require generic arguments for this return type to be complete. As is, users of this class cannot fully benefit from static analysis.The text was updated successfully, but these errors were encountered: