Question about generators.

kiwwisk at gmail.com kiwwisk at gmail.com
Mon Jan 30 13:59:10 EST 2006


Hi,
Is there a way for created generators to determine what function
created them?
Like for objects and classes function 'isinstance',

e.g.:

def gen1( ):
   yield 1

a = gen1( )

if isinstance( a, gen1 ) == True: #not functional.
   ...

Thanks for reply,
       Andrej




More information about the Python-list mailing list