Collection Interface ABCs
collections.abc.Generator
Iterators with generator-specific send, throw and close operations.
Formal Syntax & Structure
python syntaxpython
collections.abc.GeneratorReturn Value
type
Abstract base class object representing the described interface; use it for recognition or inheritance.
Working Example
Example Snippetpython
import collections.abcprint(isinstance((n for n in range(2)),collections.abc.Generator))