-
-
Notifications
You must be signed in to change notification settings - Fork 878
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
update pyright to 1.1.383 #1200
update pyright to 1.1.383 #1200
Conversation
@Kallinteris-Andreas |
Some of the errors are straight up wrong (unless I am crazy) /home/runner/work/Gymnasium/Gymnasium/gymnasium/envs/mujoco/reacher_v4.py
/home/runner/work/Gymnasium/Gymnasium/gymnasium/envs/mujoco/reacher_v4.py:29:35 - error: Argument of type "dict[str, int]" cannot be assigned to parameter "default_camera_config" of type "Dict[str, float | int] | None" in function "__init__"
Type "dict[str, int]" is not assignable to type "Dict[str, float | int] | None"
"dict[str, int]" is not assignable to "Dict[str, float | int]"
Type parameter "_VT@dict" is invariant, but "int" is not the same as "float | int"
Consider switching from "dict" to "Mapping" which is covariant in the value type
"dict[str, int]" is not assignable to "None" (reportArgumentType)
I am not strictly opposed to moving to |
note: I have edited my previous message by adding a "not", misstyping sorry |
I have disabled I have temporarily disabled the following, and marked them with TODO which can be fixed one at a time: #76 is immortal, you fix 1 issue 2 more shall take its place |
Totally, this is part of my motivation for moving to MyPY as PyRight has minimal support for NumPy which is the cause of 90% of our issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only worry with this update is that it doesn't actually fix any of the type problems, just hides them better.
An alternative approach is to use something like https://github.com/beartype/beartype which operates during testing to check that the types passed to functions match the exacted type. Quite cool imo
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist:
pre-commit
checks withpre-commit run --all-files
(seeCONTRIBUTING.md
instructions to set it up)