getting the name of a generator function

Oscar Rambla tecnic at codidoc.com
Wed Jun 11 08:48:03 EDT 2003


Hi , all

I have two questions.

1)Is there a direct way to know the name of the function generator from the 
generator instance?

Ex:
def f1():
  yield 1

def f2():
   yield f1()

g1= f2()
g2 = g1.next()

"g2 is " g2?

2)How to know the name of the module that contains a base class definition 
from a class/subclass instance?

Thank you in advance 
--Oscar





More information about the Python-list mailing list