My newbie annoyances so far
Bjoern Schliessmann
usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Sat Apr 28 04:58:25 EDT 2007
Dennis Lee Bieber wrote:
> You didn't take account of what b, c, and d were...
>
> RPL: <condition> if <truth> else <false> end
> Python: <truth> if <condition> else <false>
>
> (RPL is a somewhat common reference to the stack based language of
> the later calculators -- HP48, for instance)
I still don't see the "more sense". Python's variant seems logical
to me -- "<fetch out garbage> if <garbage can full> else <don't>".
The HP equivalent will be, if I understand correctly:
"<garbage can full> if <fetch out garbage> [else <don't>]"
I see two problems here:
- Also from my error in the last posting it's quite clear that the
RPL statement doesn't do what one would suppose. Isn't this what
Python always tries to avoid: Doing something different from what
is "obvious". RP order doesn't fit in Python, IMHO.
- What should the expression's value be if the else is omitted?
None? What's it in the original? I can't imagine a use case here
since I always have two alternatives when I use "a if b else c".
Regards,
Björn
--
BOFH excuse #110:
The rolling stones concert down the road caused a brown out
More information about the Python-list
mailing list