[Python-ideas] except expression

Rob Cliffe rob.cliffe at btinternet.com
Wed Feb 19 15:43:26 CET 2014


On 19/02/2014 13:07, Steven D'Aprano wrote:
> On Wed, Feb 19, 2014 at 10:17:05PM +1000, Nick Coghlan wrote:
>
>> That said, I did suggest using the function return type annotation
>> marker as a possibility, and that's not currently listed in the PEP:
>>
>>      value = lst[2] except IndexError -> 'No value'
> I missed that too. I prefer that to nearly all of the keyword based
> suggestions so far. In order of most preferred to least:
>
> +1   :
> +0.9 ->
> +0.5 then
> -0.5 return
> -1   pass, else
>
>
> -> also passes the Tim Peters "grit on monitor" test.
I pretty much agree.
Rob Cliffe


More information about the Python-ideas mailing list