On Sat, Feb 22, 2014 at 4:13 AM, Antoine Pitrou <solip...@pitrou.net> wrote:
> On Fri, 21 Feb 2014 09:37:29 -0800 > Guido van Rossum <gu...@python.org> wrote: > > I'm put off by the ':' syntax myself (it looks to me as if someone > forgot a > > newline somewhere) but 'then' feels even weirder (it's been hard-coded in > > my brain as meaning the first branch of an 'if'). > > Would 'else' work rather than 'then'? > thing = stuff['key'] except KeyError else None 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. 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.
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com