abbr-cli icon indicating copy to clipboard operation
abbr-cli copied to clipboard

Use proper type annotation

Open thewchan opened this issue 3 years ago • 4 comments

thewchan avatar Jul 15 '21 17:07 thewchan

Hi Matt,

Would you elaborate on the benefit(s)?

mhadidg avatar Jul 18 '21 12:07 mhadidg

Also, the commits in your other pull requests (see #2, #3) might be combined in this pull.

mhadidg avatar Jul 18 '21 13:07 mhadidg

Not sure which version of Python you're using; but using notation tuple[str] or list[str] will crash; you'll need to import the actual type attribute from the standard library typing for the typing annotation to not raise any exceptions.

See: https://docs.python.org/3/library/typing.html

thewchan avatar Jul 18 '21 19:07 thewchan

Use tuple[str] instead of importing the corresponding capitalized types(Tuple) is a python3.9 higher feature see https://docs.python.org/3.9/whatsnew/3.9.html#type-hinting-generics-in-standard-collections, the author could explict import typing to support lower version.

jiaqidegege avatar Jan 27 '22 10:01 jiaqidegege