-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
The documentation gives an example of how to create aliases:
def echo(*text:Parameter.REQUIRED,
prefix:'p'='', suffix:'s'='', reverse:'r'=False, repeat:'n'=1):
...This, however, causes most linters to warn:
Unresolved reference 'p'
for all the aliases thus defined.
Since Python 3.9, typing.Annotated is available to add metadata to annotations, so this could be defined as
def echo(*text:Parameter.REQUIRED,
prefix: Annotated[str, 'p'] ='',
suffix: Annotated[str, 's'] = '',
reverse: Annotated[str, 'r'] = False,
repeat: Annotated[int, 'n'] = 1,
):
...and linters wouldn't complain.
Metadata
Metadata
Assignees
Labels
No labels