Re: [Python-Dev] PEP 463: Exception-catching expressions

2014年2月22日 01:15:07 -0800

On 2014年2月22日 15:57:02 +0900
"Stephen J. Turnbull" <[email protected]> wrote:
> 
> try:
> interpolable = func(key)
> except TypeError:
> interpolable = "not a string: %s" % key
> except KeyError:
> interpolable = "no such key: %s" % key
> print("Some message that refers to '%s' % interpolable")
I think that's a rare enough case, though (compared to the other idioms
showcased in the PEP), that we needn't care about it.
Regards
Antoine.
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to