Python Forum

Full Version: how to join 2 iterators
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
you can join 2 lists with the + operator. but now we are getting iterators where we once got lists. usually they are effectively the same. but the + operator does not create a new iterator referencing the 2 iterators around it. is there a standard way to join 2 iterators? ideally, it would be able to handle more than 2 and a mix of iterators and sequences. if not, then i guess i need to code up another generator.
thank you!!