Passing yield as a function argument...

Christopher Reimer christopher_reimer at icloud.com
Tue May 23 22:59:18 EDT 2017


Greetings,

I have two functions that I generalized to be nearly identical except 
for one line. One function has a yield statement, the other function 
appends to a queue.

If I rewrite the one line to be a function passed in as an argument -- 
i.e., func(data) -- queue.append works fine. If I create and pass an 
inner function with the yield statement, nothing happens.

Is it possible to pass a yield statement in some form as a function 
argument?

Thank you,

Chris Reimer



More information about the Python-list mailing list