-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
PEP 484 type comments for vararg and kwarg? #1508
Comments
For what you want, you access it through
What isn't possible though is splitting up the arguments, type commenting each, and getting the annotation that way.
In that case there's no way to get the type comment. It looks like this was missing from the original representation. We should add both a |
Thank you for the workaround! I agree that |
Also, it seems like this only works for def with_variadic_typehint(
self,
*vars, # type: str
**kwargs # type: Any
):
# type: (*str, **Any) -> None
pass [<AssignName.self l.2 at 0x1e658b71240>] And **kwargs doesn't appear in the kwonlyargs either. |
It seems like the
Arguments
class only has annotations for kwarg and vararg, and does not have any property for getting the type comment.Per PEP484, this should be supported (https://peps.python.org/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code)
How would I obtain the type comment for
*fake_receipts
?The text was updated successfully, but these errors were encountered: