type lookuperror

Chris Angelico rosuav at gmail.com
Thu Aug 18 03:48:49 EDT 2016


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