type lookuperror
meInvent bbird
jobmattcon at gmail.com
Thu Aug 18 05:55:10 EDT 2016
actually i would like to remove try except code in all function
and i feel that try except code for a large block code can not
show which function name , which line number error,
if use try except for specified code block to show where it has error
it will have many ugly try except code and need many human force
to craft the code, i hope that code write once for program to program itself
in future.
actually this method i ask is not good enough since it will need
to add many function wrapper.
On Thursday, August 18, 2016 at 3:49:04 PM UTC+8, Chris Angelico wrote:
> On Thu, Aug 18, 2016 at 5:44 PM, meInvent bbird <jobmattcon at gmail.com> wrote:
> > if i use
> >
> > result = ""
> > before try
> > and return result at the end
> >
> > as return of function can be any type
> >
> > there will be type mismatch
> >
> > how to return the result of func ?
>
> If it raises an exception, it *does not have* a return value. That's
> why I let the exception continue to bubble. But fundamentally, you
> can't just carry on regardless. I recommend a complete rethink of what
> you're trying to do here.
>
> ChrisA
More information about the Python-list
mailing list