can Python be useful as functional?
Alex Martelli
aleax at mac.com
Tue Sep 18 01:24:10 EDT 2007
More information about the Python-list mailing list
Tue Sep 18 01:24:10 EDT 2007
- Previous message (by thread): can Python be useful as functional?
- Next message (by thread): can Python be useful as functional?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Rustom Mody <rustompmody at gmail.com> wrote: > Can someone help? Heres the non-working code > > def si(l): > p = l.next() > yield p > (x for x in si(l) if x % p != 0) > > There should be an yield or return somewhere but cant figure it out Change last line to for x in (x for x in si(l) if x % p != 0): yield x if you wish. Alex
- Previous message (by thread): can Python be useful as functional?
- Next message (by thread): can Python be useful as functional?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list