Laurent, unfortunately that would only work for one particular program or
task. I was hoping to use everywhere the kind of list operations I
mentioned.

Besides, the unreadability problem is still there. You have only transfered
it to the function definition.

On Fri, Jul 17, 2009 at 7:40 AM, Laurent <moky.m...@gmail.com> wrote:

>
> Carlos Córdoba ha scritto:
> >> [[cos(a/9), sin(a/9)] for a in [b+3 for b in [2*c for c in [1,2,3]]]]
> >>
> >> (This is using a/9 instead of a/max(z) since I don't know how to do
> >> 'max(z)' in a one-liner like this.)
> >>
> >>
> >
> > Thanks John, when I was talking about unreadable comprehensions I was
> > meaning this. i.e. nested ones. Then was when I thought it would be so
> much
> > easier and beautiful to just write 3 + (2 * [1,2,3]), but unfortunately
> it
> > seems not possible in regular python
> >
> >
>
> If your problem is the readablness[1], the following trivial trick may
> help you :
>
> def toto(list):
>   return  [[cos(a/9), sin(a/9)] for a in [b+3 for b in [2*c for c in
> list ]]]
>
> It makes your main code much more readable, even if you use it only once.
>
> Good afternoon
> Laurent
>
> [1] What's the right word in English ?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to