In article <pine.lnx.4.64.0901210811430.14...@kimball.webabinitio.net>, rdmur...@bitdance.com wrote:
>... > I understand that you are saying that 'while x' is used in the same > logical sense ("take a different action when x is no longer true"), > but that I don't feel that that is enough to say that it has similar > semantics. Or, perhaps more accurately, it is just similar enough to be > very confusing because it is also different enough to be very surprising. > The semantics of 'while' in python includes the bit about creating a > loop, and does _not_ include executing a 'break' in the surrounding loop. > To give 'while' this new meaning would be, IMO, un-pythonic. (If python > had a 'for/while' construct, it would be a different story...and then > it would probably already be part of the list comprehension syntax.) I agree. I feel that the term "while" is a poor choice for "when this is no longer true then stop". It sounds more like a synonym for "if" to me. I would be much more comfortable using "until" (in the opposite sense to the proposed "while"); it clearly implies "we're done so stop". I don't know if it's a feature that is really useful, but I do think it would be transparent: code that used it would be easily understood. -- Russell _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com