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.
The documentation gives an example of how to create aliases:
This, however, causes most linters to warn:
Unresolved reference 'p'for all the aliases thus defined.
Since Python 3.9,
typing.Annotatedis available to add metadata to annotations, so this could be defined asand linters wouldn't complain.