No greeting, no text? Pity.

Roland Puntaier wrote:

> def changeOne(aa,idx):
>   aa[idx]=not aa[idx]
>   yield aa
>   for i in range(idx):
>     for x in changeOne(aa,i):
>       yield x
> 
> def changeOneOrder(aa):
>   yield aa
>   for i in range(len(aa)):
>     for x in changeOne(aa,i):
>       yield x

Okay, two generator definitions.
 
> a=[False]*3
> og=changeOneOrder(a)
> #this does not return the way I would expect. why?

What do you expect? You created a generator object and bound it
to "og".

Please always state what you expect and what really happens. Fortune
telling is not one of my hobbies (and I think I'm not alone with
that).

Regards,


Björn

-- 
BOFH excuse #284:

Electrons on a bender

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to