[Python-Dev] ',' precedence in documentation (original) (raw)

Guido van Rossum guido at python.org
Mon Sep 15 06:12:40 CEST 2008


On Sun, Sep 14, 2008 at 8:55 PM, Leif Walsh <leif.walsh at gmail.com> wrote:

On Sun, Sep 14, 2008 at 11:36 PM, Eric Smith <eric at trueblade.com> wrote:

If we really want to change it, I think: assert B as S is better because S is the string to report; that is, "if B is false, report the problem as the string S".

'else' implies to me what to do if you're not failing the assert, which is not the case. Doesn't imply that to me. I read it as 'first you assert that B is true; if not (else), you print S'. Personally, I like 'else' better than 'as', because 'as' seems to contain the notion of assignment.

That's my gut feeling too, but I don't like 'else' all that much either (if would also make things like"assert x if t else b, msg" less readable I think). Maybe "assert B with S"???

FWIW I don't like turning it into a function either, and I really don't like keeping the keyword but changing the syntax to be function-like.

-- --Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list