Type annotation for itertools #1207
Unanswered
dineshbvadhia
asked this question in
Q&A
Replies: 3 comments 2 replies
|
You are attempting to assign a value of type |
0 replies
|
Using reveal_locals() in get_pair() gives: builtins.list[builtins.int] is list[int], but what is the translation of 'itertools.islice[Tuple[builtins.int, builtins.int]] for pair? |
1 reply
|
Ok, got a mypy Success with: Thank-you. What is the significance of the '...' in tuple[int, ...] ? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This convoluted example produces pairs of integers. The first integer is from a 'number' list and the second is an odd integer using itertools.slice. Once the pairs are produced, the 'number' and matching 'odd' integer lists are extracted using zip(,). The code works but mypy throws the errors shown below:
All reactions