Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49098 > unrolled thread

Re: Is this PEP-able? fwhile

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2013-06-24 16:43 -0600
Last post2013-06-24 16:43 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Is this PEP-able? fwhile Ian Kelly <ian.g.kelly@gmail.com> - 2013-06-24 16:43 -0600

#49098 — Re: Is this PEP-able? fwhile

FromIan Kelly <ian.g.kelly@gmail.com>
Date2013-06-24 16:43 -0600
SubjectRe: Is this PEP-able? fwhile
Message-ID<mailman.3779.1372113865.3114.python-list@python.org>
On Mon, Jun 24, 2013 at 4:41 PM, Fábio Santos <fabiosantosart@gmail.com> wrote:
>
> On 24 Jun 2013 22:29, "Ian Kelly" <ian.g.kelly@gmail.com> wrote:
>>
>> On Mon, Jun 24, 2013 at 2:34 PM, Fábio Santos <fabiosantosart@gmail.com>
>> wrote:
>> > This can probably be best achieved by adding to the existing for loop,
>> > so maybe taking advantage of the existing for...if syntax and adding
>> > for...while would be a better idea?
>>
>> The for...if syntax only exists for comprehensions and generators.  If
>> we're going to add for...while for loops, then we might as well go
>> ahead and add for...if loops there as well.
>>
>> That said, I do like this syntax better than "fwhile".
>
> Good point. Still, I don't see why for..if doesn't exist in for loops
> anyway. It may be lack of foresight, but I don't understand why at all.

Because it adds more syntax to learn when learning the language, it
introduces more maintenance overhead, and it offers no clear benefit
over simply nesting an if inside a for.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web