Thanks for reply :) I'm little sceptic about this code: >>> a = gen1() >>> a.gi_frame.f_code.co_name 'gen1' will it be compatible with Python 2.3, 2.4, 2.5+ and future versions? Seems very internal and subject of future change. A.