"m g william" <mgbg25171 at blueyonder.co.uk> wrote in message
news:mailman.1253.1159962380.10491.python-list at python.org...
<snip>
> #now replace all 'rng's with consecutive streams
> #===============================================
> def static_num():
> ''' this is a generator function that avoids globals
> yield differentiates fn as generator fn which freezes
> '''
> x = 0
> while True:
> x += 1
> yield str(x)
>> static = static_num().next
Also, check out itertools.count (one of many tools from the excellent
itertools module), as in:
static - itertools.count().next
- no need to roll this function for yourself. You still need to call it for
each substitution, though, as described elsewhere.
-- Paul