Skip to content

Use proper type annotation#1

Open
thewchan wants to merge 1 commit intomhadidg:masterfrom
thewchan:patch-1
Open

Use proper type annotation#1
thewchan wants to merge 1 commit intomhadidg:masterfrom
thewchan:patch-1

Conversation

@thewchan
Copy link
Copy Markdown

No description provided.

@mhadidg
Copy link
Copy Markdown
Owner

mhadidg commented Jul 18, 2021

Hi Matt,

Would you elaborate on the benefit(s)?

@mhadidg
Copy link
Copy Markdown
Owner

mhadidg commented Jul 18, 2021

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

@thewchan
Copy link
Copy Markdown
Author

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

@jiaqidegege
Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants