Skip to content

Conversation

@picnixz
Copy link
Member

@picnixz picnixz commented Apr 15, 2024

This adds better type annotations (namely type guards) for the inspect module. This helps in removing some # type: ignore in other modules. In addition, I forced (in this PR and not the previous one) some literal values for the rendering modes.

The main issue with restify and stringify_annotation is that those functions are really big and they were probably incremented along the years. However, with all those type: ignore, some assumptions were not explicitly stated and this is quite bothersome when you want to debug.

@picnixz picnixz changed the title Improve type annotations for sphinx.util.inspect Improve type annotations for sphinx.util.inspect [part 2d] Apr 15, 2024
@AA-Turner AA-Turner force-pushed the cleanup/util-2d-type-guards branch from ab3b8fb to 120dbb7 Compare April 23, 2024 04:48
@AA-Turner AA-Turner changed the title Improve type annotations for sphinx.util.inspect [part 2d] Use TypeGuard for the sphinx.util.inspect functions Apr 23, 2024
@AA-Turner AA-Turner changed the title Use TypeGuard for the sphinx.util.inspect functions Use TypeGuard in sphinx.util.inspect Apr 23, 2024
@AA-Turner AA-Turner merged commit acc92ff into sphinx-doc:master Apr 23, 2024
@picnixz picnixz deleted the cleanup/util-2d-type-guards branch April 23, 2024 10:25
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2024
@AA-Turner AA-Turner added this to the 7.4.0 milestone Jul 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants