Skip to content

PEP 484 type comments for vararg and kwarg? #1508

Open
@tjprescott

Description

@tjprescott

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)

def embezzle(self, account, funds=1000000, *fake_receipts):
    # type: (str, int, *str) -> None
    """Embezzle funds from account using fake receipts."""
    <code goes here>

How would I obtain the type comment for *fake_receipts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancement ✨Improvement to a componentGood first issueFriendly and approachable by new contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions