'Combine two generators and preserve send method [closed]

I have a generator that I can send values to using the generator.send() method. I'd like to add to this generator after it has been made and continue using the same functions to iterate through it. I tried itertools.chain, but that returns an iterator and I get an AttributeError when I try to send values to it.

How can I combine two generators and preserve the ability to send values to them?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source