[Python-ideas] except expression
Philipp A.
flying-sheep at web.de
Sun Feb 16 13:16:38 CET 2014
2014-02-15 20:57 GMT+01:00 Steven D’Aprano <steve at pearwood.info>:
That is incorrect. Did you read my full post? I specifically mentioned
both dicts and lambda, both of which use colons in expressions, and
don’t start a new block.
oh, sorry, totally overlooked that.
i wouldn’t count dicts (and slices), as they are literals of sorts, but
lambdas are exactly what we’re sidcussing about: a expression, instisting
of sub-expression, one of which is after a colon.
forget my post. i now like the colon variant, as well as the “pass” and
“try” variants, with no clear preference.
“pass” is a placeholder null statement, it has no relevance to
try…except. You might just as well sensibly say
stomach_content = eat() except ThinMintError import explode()
stomach_content = eat() except ThinMintError del explode()
stomach_content = eat() except ThinMintError class explode()
stomach_content = eat() except ThinMintError def explode()
stomach_content = eat() except ThinMintError pass explode()
In all of these cases, I have picked a random keyword and just tossed it
into the expression. None of them make any sense.
hah! now it’s my turn to smugly say “did you even read my post?!” ;)
2014-02-13 14:19 GMT+01:00 Philipp A. <flying-sheep at web.de>:
pass is only used to mean “do nothing” right now, and indeed that’s fitting:
it’s just a border between EXC_TYPE [as EXC_NAME] and ALT_EXPR,
*and its other meaning makes sense in english grammar*. Maybe even try?
Like “use this, except if that doesn’t work, then try using the other
thing”.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140216/d7f678c6/attachment.html>
More information about the Python-ideas
mailing list