Change return of external function python

The contains this code:

def external_func():
return [list comprehension]

I want import the external_func() in another file.

import external_func() from my_module

Now i want use a wrapper, or other way to change the return into iterator.

return iter(list comprehension)

Any suggestions are appreciate!

Read more here:

Content Attribution

This content was originally published by Raffaele Ruggeri at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: