Bug Bounties  ### How to write a meaningful typehint for a function that returns a filter?

Assume the following function ``` def get_list_of_nums_and_square_nums_with_last_digit_9() -&gt; List[Tuple[int, int]]: sqr = lambda n: n * n is_last_digit_9 = lambda n: n % 10 == 9 is_last_digit_of_square_num_9 = lambda t: (lambda n, n_squared: is_last_digit_9(n_squared))(*t) nums_and_square_nums = map(lambda n: (n, sqr(n)), range(10)) return list(filter(is_last_digit_of_square_num_9, nums_and_square_nums)) ``` which would return ``` &gt;&gt;&gt; get_list_of_nums_and_square_nums_with_last_digit_9() [(3, 9), (7, 49)] ``` . Now I want an equivalent function, but returning a iterator - or more specifically a filter: ``` def get_nums_and_square_nums_with_last_digit_9(): sqr = lambda n: n * n is_last_digit_9 = lambda n: n % 10 == 9 is_last_digit_of_square_num_9 = lambda t: (lambda n, n_squared: is_last_digit_9(n_squared))(*t) nums_and_square_nums = map(lambda n: (n, sqr(n)), range(10)) return filter(is_last_digit_of_square_num_9, nums_and_square_nums) ``` Which type hints can I use so that we can clearly see the structure of the result, when the resulting filter is applied? Is `Iterator[Tuple[int, int]]` correct? Or is there a more precise way to do it? Somehow it should be possible to determine the elements&#39; structure `Tuple[int, int]` from the typehint. Hacking events