Re: [Python-Dev] while:

2005-07-21 Thread Gareth McCaughan
On Thursday 2005-07-21 01:22, Martin Blais wrote:

> The Rule of Least Surprise says to me that "while:" would do the least
> unexpected thing.  There are only two possibilities: the test is
> implicitly false, in which case "while:" would make no sense (i.e. the
> block would be ignored).  Therefore the other only sensible case is
> that the test is implicitly true, which can be useful (and also
> happens to be a very common idiom).

To me, the "least unexpected thing" for "while:" to do is to
raise a syntax error. The principle of least surprise doesn't
mean that for every sequence of tokens you should pick the
least surprising thing it could do, and give it that definition.
(That's what they do in C++, except for the bit about picking
the least surprising semantics.)

-- 
g

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] while:

2005-07-21 Thread Ruslan Spivak
В Срд, 20/07/2005 в 21:58 -0300, Facundo Batista пишет:
> On 7/20/05, Martin Blais <[EMAIL PROTECTED]> wrote:
> 
> > Well, maybe you're reading a bit too litterally into that statement.
> > To me the expression is very explicitly absent :-)More seriously,
> > reading into these rules too literally leads to funny places: I could
> > ask why at the end of functions there is an implicit "return None"
> > (I'm not expecting an answer).  Explicit better than implicit?
> 
> See your point.
> 
> But, for me (spanish speaker), if I read a ``while:``, I think, "while what?".
> 

The same here, so -1 for while:

Ruslan


___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com