Revisit `# type: ignore # pending ...` comments
This is a note that I've adopted a specific format for # type: ignore comments when they are caused by issues in upstream packages such as pyglet. In these cases, the proper fix should happen in the upstream library, not in arcade.
However, waiting for the upstream fix to be implemented, merged, and published to pypi would take too long. In the interim, arcade's CI would fail with errors. Even if we chose to ignore the errors, they would confuse beginners and obscure more meaningful errors.
In these situations, I suppress the errors with a comment of the form:
# type: ignore # pending https://github.com/pyglet/pyglet/issues/843
This oddly-specific syntax is compatible with both mypy and pyright. Even if arcade uses pyright, it's nice to be compatible with down-stream users who may choose mypy. Mypy, for example, logs an error for # type: ignore pending but it is happy if we add that extra #.
This comment clearly links to a description of the underlying issue. It has zero changes to arcade's python syntax -- is guaranteed not to affect runtime behavior -- so hopefully it's non-controversial. When the upstream issue is fixed, we can remove the comment.
This issue serves as documentation of this convention. If appropriate, we can add it to the programming guide and close this issue.
I tweaked the formatting of the above after learning that mypy is touchy about the formatting of these comments. pyright espouses # type: ignore -- actual comment but is happy with mypy's format, # type: ignore # actual commetn
Added to CONTRIBUTING.md with a link to this issue