<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Feb 22, 2014 at 4:13 AM, Antoine Pitrou <span dir="ltr"><<a href="mailto:solipsis@pitrou.net" target="_blank">solipsis@pitrou.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Fri, 21 Feb 2014 09:37:29 -0800<br>
Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br>
> I'm put off by the ':' syntax myself (it looks to me as if someone forgot a<br>
> newline somewhere) but 'then' feels even weirder (it's been hard-coded in<br>
> my brain as meaning the first branch of an 'if').<br>
<br>
</div>Would 'else' work rather than 'then'?<br></blockquote><div><br></div><div>thing = stuff['key'] except KeyError else None</div><div><br></div><div>That reads to me like the exception was silenced and only if there is no exception the None is returned, just like an 'else' clause on a 'try' statement.</div>

<div><br></div><div>I personally don't mind the 'then' as my brain has been hard-coded to mean "the first branch of a statement" so it's looser than being explicitly associated with 'if' but with any multi-clause statement.</div>

</div></div></div>