PEP 308: Pep Update

sismex01 at hebmex.com sismex01 at hebmex.com
Thu Feb 27 10:02:52 EST 2003


> From: Robin Becker [mailto:robin at jessikat.fsnet.co.uk]
> Sent: Thursday, February 27, 2003 3:23 AM
> 
> I think you are wrong on this: mathematics, logical calculus,
> engineering et al. all use abstract symbolism. It improves 
> communication amongst those in the field. people seem to have
> little difficulty in picking up such syntax.
> 
> If we rigorously adopted your approach then 'a+y' would have to be
> replaced by 'a add y' or similar. It may be that poor 'dumb' 
> programmers can't hack symbols if so we're in real trouble.
> 

No need to refute an opinion by taking it to an extreme
and making it absurd (reduction to absurdum?).  After all,
Norman isn't talking about eliminating operators, but
expressing his opinion on *WHY* he believes that the
conditional ternary operator should be in the form
(TRUE if COND else FALSE) instead of (COND ? TRUE : FALSE),
**in Python's specific case**.

Better argue the benefits of ( COND ? TRUE : FALSE ) instead
of "absurdizing" ( TRUE if COND else FALSE ).

As I said on another PEP-308 related thread, "wordy" syntax
constructions are more "Pythonic", because they read like
pseudo-code, similar to normal Python code.  It's all about
readability.

In my opinion (using parens just for clarity):

+1:     ( TRUEVAL if CONDITION_TRUE else FALSEVAL )

+0.5:   ( TRUEVAL else FALSEVAL if CONDITION_FALSE )
        ( when CONDITION_TRUE then TRUEVAL else FALSEVAL )

+0:     no changes.

-1:     C-style syntax.

-gustavo





More information about the Python-list mailing list