25 Jun
2013
25 Jun
'13
6:17 p.m.
On 25 June 2013 18:12, Shane Green <shane@umbrellacode.com> wrote:
[x for x in l if x < 10 else break]?
Humorously, this works: def brk(): raise StopIteration (x if x < 10 else brk() for x in range(100)) list(x if x < 10 else brk() for x in range(100)) Quirkily, but obvious with thought, this does not: [x if x < 10 else brk() for x in range(100)]