Looping [was Re: Python and the need for speed]

eryk sun eryksun at gmail.com
Mon Apr 17 22:11:09 EDT 2017


On Tue, Apr 18, 2017 at 1:37 AM, MRAB <python at mrabarnett.plus.com> wrote:
> In Python 3 it's:
>
> c = next(itertools.dropwhile(
>      lambda c: c==' ',
>      iter(lambda: sys.stdin.read(1),None)
>      ))

iter's sentinel should be an empty string.


More information about the Python-list mailing list