Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
TBH, I am not sure we need to document something not actually available at runtime here.
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.
A bit of a meta ramble: One of the problems is that there is not central "typing documentation". Most things are described in PEP 484, the typing documentation and mypy's documentation and there is a significant overlap, but some things are only described in one of them. The typeshed CONTRIBUTING file has a bit more stuff, too. Although by now I'd describe myself as fairly experienced regarding typing, I am still always looking for the right document when I encounter a corner case or want to link someone the documentation.
In the long term we should probably have a comprehensive guide on https://docs.python.org/ and link to that from the other documentation. But until that is the case, I don't think PEP 484 should be the only place where this is documented. And while it is not available at runtime,
@type_check_onlyis imported from typing, so its documentation is where I would look for it.