Re: Arent these snippets equivalent?

2013-01-23 Thread Coolgg
On Wednesday, January 23, 2013 6:38:54 PM UTC-8, Terry Reedy wrote: > On 1/23/2013 6:29 PM, Tim Chase wrote: > > > On 01/23/13 16:47, Roy Smith wrote: > > >> while getchar() as c: > > >> putchar(c) > > >> > > >> That would give people (including me) the use case they're after most of > >

Arent these snippets equivalent?

2013-01-23 Thread Coolgg
Is this: while True: data = fp.read(4096) if not data: break ... not equivalent to this: data = fp.read (4096) while data: ...{handle the chunk here} data = fp.read (4096) Heres the article that sparked this question: http://wordaligned.org/articles/pythons-lesser-kn