This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import Generator | |
| def iterize(generator: Generator): | |
| """ | |
| This function creates an iterable object from the generator you pass here, | |
| it helps when function expects an iterable, but you have a generator. | |
| :param generator: generator that you want to wrap. | |
| :return: an iterable object. | |
| """ | |
| return type('_wrappedGenerator', (), { |
NewerOlder