On Sat, 20 Dec 2008, John O'Hagan wrote:
> On Sat, 20 Dec 2008, Terry Reedy wrote:
> > John O'Hagan wrote:
> > > I have a lot of repetitive assignments to make, within a generator,
> > > that use a function outside the generator:
> > >
> > > var1 = func("var1", args)
> > > var2 = func("var2", args)
On Dec 19, 11:34 pm, John O'Hagan wrote:
> I have a lot of repetitive assignments to make, within a generator, that use a
> function outside the generator:
>
> var1 = func("var1", args)
> var2 = func("var2", args)
> var3 = func("var3", args)
> etc...
>
> In each case the args are identical, but th
On Sat, 20 Dec 2008, Terry Reedy wrote:
> John O'Hagan wrote:
> > I have a lot of repetitive assignments to make, within a generator, that
> > use a function outside the generator:
> >
> > var1 = func("var1", args)
> > var2 = func("var2", args)
> > var3 = func("var3", args)
> > etc...
> >
> > In ea
On Sat, 20 Dec 2008, Steven D'Aprano wrote:
> On Sat, 20 Dec 2008 02:53:16 +, MRAB wrote:
> > If you're sure you want to use the current namespace then:
> >
> > for name in namelist:
> > vars()[name] = func(name, args)
>
> Doesn't work inside a function:
> >>> def parrot():
>
> ..
On Sat, 20 Dec 2008, Arnaud Delobelle wrote:
> John O'Hagan writes:
> > I have a lot of repetitive assignments to make, within a generator,
> > that use a function outside the generator:
> >
> > var1 = func("var1", args)
> > var2 = func("var2", args)
> > var3 = func("var3", args)
> > etc...
> >
>
John O'Hagan writes:
> I have a lot of repetitive assignments to make, within a generator,
> that use a function outside the generator:
>
> var1 = func("var1", args)
> var2 = func("var2", args)
> var3 = func("var3", args)
> etc...
>
> In each case the args are identical, but the first argument is
On Sat, 20 Dec 2008 02:53:16 +, MRAB wrote:
> If you're sure you want to use the current namespace then:
>
> for name in namelist:
> vars()[name] = func(name, args)
Doesn't work inside a function:
>>> def parrot():
... for name in ['A', 'B', 'C']:
... vars()[na
Terry Reedy wrote:
John O'Hagan wrote:
I have a lot of repetitive assignments to make, within a generator,
that use a function outside the generator:
var1 = func("var1", args)
var2 = func("var2", args)
var3 = func("var3", args)
etc...
In each case the args are identical, but the first argumen
John O'Hagan wrote:
I have a lot of repetitive assignments to make, within a generator, that use a
function outside the generator:
var1 = func("var1", args)
var2 = func("var2", args)
var3 = func("var3", args)
etc...
In each case the args are identical, but the first argument is a string of the