typing.Generator
ジェネレータはジェネリック型 Generator[YieldType, SendType, ReturnType] によってアノテーションを付けられます。
もしジェネレータが値を返すだけの場合は、 SendType と ReturnType に None を設定してください:
代わりに、ジェネレータを Iterable[YieldType] や Iterator[YieldType] という返り値の型でアノテーションをつけることもできます:
typing.Iteratorはtyping.Iterableを継承
typing.Generatorはtyping.Iteratorを継承
これらはPython 3.9から非推奨