Re: Sending changed parameters into nested generators

2011-01-21 Thread John O'Hagan
On Fri, 21 Jan 2011, cbrown wrote: On Nov 12, 10:52 pm, John O'Hagan resea... at johnohagan.com wrote: On Sat, 13 Nov 2010, Steven D'Aprano wrote: On Fri, 12 Nov 2010 09:47:26 +, John O'Hagan wrote: I have a generator function which takes as arguments another generator and a

Re: Sending changed parameters into nested generators

2010-11-18 Thread cbr...@cbrownsystems.com
On Nov 12, 10:52 pm, John O'Hagan resea...@johnohagan.com wrote: On Sat, 13 Nov 2010, Steven D'Aprano wrote: On Fri, 12 Nov 2010 09:47:26 +, John O'Hagan wrote: I have a generator function which takes as arguments another generator and a dictionary of other generators like this:

Sending changed parameters into nested generators

2010-11-12 Thread John O'Hagan
I have a generator function which takes as arguments another generator and a dictionary of other generators like this: def modgen(gen, gendict): for item in gen(): for k, v in gendict: do_something_called_k(item, v.next()) yield item I want to control the

Re: Sending changed parameters into nested generators

2010-11-12 Thread Ian
On Nov 12, 2:47 am, John O'Hagan resea...@johnohagan.com wrote: I have tried using a deep update function on the original nested dictionary, but this only works if I  change the contents of a list, not if I want to, say, change a node from a list to a dictionary or vice versa, because in that

Re: Sending changed parameters into nested generators

2010-11-12 Thread Arnaud Delobelle
John O'Hagan resea...@johnohagan.com writes: I have a generator function which takes as arguments another generator and a dictionary of other generators like this: def modgen(gen, gendict): for item in gen(): for k, v in gendict: do_something_called_k(item,

Re: Sending changed parameters into nested generators

2010-11-12 Thread John O'Hagan
On Fri, 12 Nov 2010, Ian wrote: On Nov 12, 2:47 am, John O'Hagan resea...@johnohagan.com wrote: I have tried using a deep update function on the original nested dictionary, but this only works if I change the contents of a list, not if I want to, say, change a node from a list to a

Re: Sending changed parameters into nested generators

2010-11-12 Thread Steven D'Aprano
On Fri, 12 Nov 2010 09:47:26 +, John O'Hagan wrote: I have a generator function which takes as arguments another generator and a dictionary of other generators like this: def modgen(gen, gendict): for item in gen(): for k, v in gendict:

Re: Sending changed parameters into nested generators

2010-11-12 Thread John O'Hagan
On Sat, 13 Nov 2010, Steven D'Aprano wrote: On Fri, 12 Nov 2010 09:47:26 +, John O'Hagan wrote: I have a generator function which takes as arguments another generator and a dictionary of other generators like this: def modgen(gen, gendict): for item in gen(): for k, v in