Is it possible to create an attribute on a generator object?
Here's a very simple example:
def filter(x):
for line in myContent:
if line == x:
yield x
Now say I have a lot of these filter generator objects floating around... maybe some of them are anonymous... I want to go back later and interrogate them for what they are filtering for. Is there a way I can a) interrogate the generator object for the value of x or b) set an attribute with the value of x that I can later interrogate?
Thanks