Skip to content
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

Improve the documentation around type comments and annotations #1509

Open
AWhetter opened this issue Apr 13, 2022 · 0 comments
Open

Improve the documentation around type comments and annotations #1509

AWhetter opened this issue Apr 13, 2022 · 0 comments
Labels
Documentation 📗 Enhancement ✨ Improvement to a component

Comments

@AWhetter
Copy link
Contributor

The documentation needs some more detail on these areas because:

  • It doesn't mention why Arguments.type_comment_args and FunctionDef.type_comment_args both exist. Perferably some examples would be included.
  • It specifies the types of many of these fields as NodeNG, when they're probably only Subscript, Const, or Name nodes.
  • It doesn't mention that Arguments.type_comment_args is prepended with a None when the first argument is a (correctly) non-annotated self or cls argument.
  • Using these fields to get type information is incredibly difficult. It requires doing a complex merge operation of the various type fields to figure out what's actually being used. We could provide either a utility to do this, or some example code. Example code may help to explain what each field is for.
@AWhetter AWhetter added Enhancement ✨ Improvement to a component Documentation 📗 labels Apr 13, 2022
@AWhetter AWhetter self-assigned this Apr 13, 2022
@AWhetter AWhetter removed their assignment Mar 23, 2023
@Pierre-Sassoulas Pierre-Sassoulas pinned this issue May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation 📗 Enhancement ✨ Improvement to a component
Projects
None yet
Development

No branches or pull requests

1 participant