Skip to content

should warn if List is not imported #1427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tharvik opened this issue Apr 22, 2016 · 3 comments
Closed

should warn if List is not imported #1427

tharvik opened this issue Apr 22, 2016 · 3 comments

Comments

@tharvik
Copy link
Contributor

tharvik commented Apr 22, 2016

 a = [1]  # type: List[int]

do not give any warning, but

 a = (1,)  # type: Tuple[int]

gives

list.py:1: error: Name 'Tuple' is not defined
@refi64
Copy link
Contributor

refi64 commented Apr 22, 2016

Does the latter work if you do a = (1,)?

@tharvik
Copy link
Contributor Author

tharvik commented Apr 22, 2016

@kirbyfan64 ho, typo from my part, that's true, I'm editing my post; but the warning is still there.

@gvanrossum
Copy link
Member

This is a duplicate of bug #999. For your program to be correct, both List and Tuple ought to be imported from the typing module.

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

No branches or pull requests

3 participants