Re: [Python-Dev] PEP 409 and the stdlib

2013年5月21日 03:13:54 -0700

On 05/21/2013 11:56 AM, Serhiy Storchaka wrote:
try:
 x = d['key']
except KeyError:
 x = fallback('key')
def fallback(key):
 if key not in a:
 raise BusinessError(...)
 return 1 / a[key] # possible TypeError, ZeroDivisionError, etc
Yes, in that case the exception will appear unintentional and you get the old message — it's on a best-effort basis.
Hrvoje
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to