Reputation: 4244
def a_generator() -> Generator[Tuple[int, int]]:
# blah blah blah.
# Do some stuff to make some ints.
yield int_one, int_two
Did I do that return type annotation correctly?
Upvotes: 2
Views: 438
Reputation: 11814
It looks like you could use:
def a_generator() -> Iterator[Tuple[int, int]]:
# blah blah blah.
# Do some stuff to make some ints.
yield int_one, int_two
From the Generator
example in PEP 0484, it looks like Generator
takes three arguments.
Also see the documentation for the typing module.
Upvotes: 1