Expose multi-line function argument type annotation comments #665
Labels
Enhancement ✨
Improvement to a component
Good first issue
Friendly and approachable by new contributors
Feature Request
Say we are parsing the following function:
There is no way to access the type annotation comments for the individual
a
andb
arguments, only the function itself.typed_ast
exposes these type comments through the attributetype_comment
on eacharg
node:Desired behavior
We could add a
type_annotation
attribute to theAssignName
node, but for regular assignments this is redundant information because type comments are exposed on the parentAssign
node.So the parent
Arguments
node seems like the right place for it to go. I'm proposing the addition of atype_comment_args
attribute on theArguments
node that contains a list of the type comments, one for each argument using a None for arguments that are missing a comment.python -c "from astroid import __pkginfo__; print(__pkginfo__.version)"
output2.2.5
The text was updated successfully, but these errors were encountered: