[Proposal] Add strict type hinting for core.py and spaces

Author: pseudo-rnd-thoughtsCreated Sep 11, 2022Updated Jul 2, 2026
Labelsenhancementgood first issue

Gymnasium inherits some of the type hinting that we completed for gym However, having strict type hinting at the critical parts of the project could be an important improve

Known issues:

  • Pyright raises an issue for overwriting a variable with a property. This is an issue for variables like metadata and spec which Wrapper overwrites with a property. We could ignore this issue or change metadata and spec to be specs in Env with a hidden _metadata and _spec

Source: Farama-Foundation/Gymnasium