builtins.TypeError: catching classes that do not inherit from BaseException is not allowed

hongy...@gmail.com hongyi.zhao at gmail.com
Thu Dec 30 18:27:18 EST 2021


On Friday, December 31, 2021 at 7:04:24 AM UTC+8, Chris Angelico wrote:
> Neither of these wants to be recursive, and writing them recursively 
> pollutes the function signature with parameters that really exist just 
> to be local variables. Passing an accumulator down is a terrible way 
> to demonstrate the beauty of recursion - it instead shows off how you 
> can shoehorn anything into recursion and make it worse in the process. 

Then what cases/scenarios can demonstrate the beauty of recursion?

HZ


More information about the Python-list mailing list