Are there any performance considerations for using a lot of generators chained together, as opposed to just a single generator.
For example:
def A(self, items):
for item in self.AB(items):
if object.A():
yield item
def AB(self, items):
for object in self.ABC(objects):
if object.A() or object.B():
yield object
def ABC(self, objects):
for object in objects:
if object.A() or object.B() or object.C():
yield object
Clearly calling A(objects) is going to go through three different generators, but in many situations it makes the code re-use better if there are different generators to handle different filtering. Can anyone indicate that there is a significant impact on performance using this technique?