he leftmost for clause cannot be evaluated in the
> enclosing scope as they may depend on the values obtained from the leftmost
> iterable. For example: (x*y for x in range(10) for y in range(x, x+10)).
> """
>
> So, it's simply because the iterable expression in the
Le 14/03/19 à 10:45, Peter Otten a écrit :
> Pierre Reinbold wrote:
>
>> Wow, thank you Ian for this very detailed answer, and thank you for taking
>> the time for that! Much appreciated!
>>
>> If I get this right, I have to somehow fix the value of a_list during
he leftmost for clause cannot be evaluated in the
> enclosing scope as they may depend on the values obtained from the leftmost
> iterable. For example: (x*y for x in range(10) for y in range(x, x+10)).
> """
>
> So, it's simply because the iterable expression in the
Dear all,
I want to implement a function computing the Cartesian product if the elements
of a list of lists, but using generator expressions. I know that it is already
available in itertools but it is for the sake of understanding how things work.
I already have a working recursive version, and I
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 06/18/2010 11:48 PM, Terry Reedy wrote:
> On 6/18/2010 3:57 PM, Pierre Reinbold wrote:
>
>> def genexp_product(*args):
>> pools = map(tuple, args)
>> result = [[]]
>> for pool in pools:
>>
Hi all,
This is my first post on the list. I'm mainly a sysadmin and no expert
in programming languages, so this may be a stupid question but it
puzzles me.
I was pondering on the documentation of the function product(*args,
**kwds) in the itertools module. It is said that:
This function is equi