-
-
Notifications
You must be signed in to change notification settings - Fork 839
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 the spaces for complete type hinting (and updates numpy to 1.21) #37
Update the spaces for complete type hinting (and updates numpy to 1.21) #37
Conversation
This waiting for the python 3.6 PR to be merged |
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.
There's a bunch of comments, a good chunk of them being rather pedantic (but many of the changes themselves are pedantic as well, so if we're doing it, we need to do it right)
Most notably I don't really like the pattern of putting Something[Any]
everywhere, it doesn't add any information and is just additiona visual clutter.
Also many of the comments apply to multiple places in the code, I didn't comment each individual instance to avoid 100+ review comments
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.
One small stylistic comment, I'm fine with everything else (but check the CI, it might have been failing outside of the gitlab/github mess)
A lot of the spaces in Gymnasium have partial type hints, are missing type hints or have incorrect type hints
This PR fixes and adds a number of type hints in Spaces using the np.NDArray type hints that allows the dtype of a numpy array to be specified.
The aim of this PR is to enable the GeneralTypeHint in pyright for future PRs
One of the requirements of this PR is
np.typing.NDArray
which was introduced in1.21.0
to numpy.