What's the use of the else in try/except/else?
ppearson at nowhere.invalid
Tue May 12 11:45:09 EDT 2009
On 12 May 2009 09:35:36 GMT, Steven D'Aprano wrote:
> To really be safe, that should become:
> rsrc = get(resource)
> except ResourceError:
> log('no more resources available')
Thanks, Steven. I find these examples illuminating.
Not trying to be dense, but given that the "except" block
re-raises the exception, isn't the above the same as . . .?
rsrc = get(resource)
log('no more resources available')
To email me, substitute nowhere->spamcop, invalid->net.
More information about the Python-list