Re: How to keep a function as a generator function when the yield operator is moved into its sub-functions??

2009-07-15 Thread weafon
(self): while(now()Based on Miles's suggestion, we can solve the problem by using 'return' in SegmentA() and keeping 'yield' in ReqServ(). For example, class RAID(Process): def ReqServ(self): while(now() weafon wrote: Hi guys, I have a question about the u

How to keep a function as a generator function when the yield operator is moved into its sub-functions??

2009-07-14 Thread weafon
define the commoncode() as an inline function or marco. Unfortunately, inline and marco do not seems to be implemented in python. Thus, how can I isolate a common segment into a function when there are yield operations in the common segment? Thanks, Weafon -- http://mail.python.org/mailma