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:57:25 EST 2021


On Friday, December 31, 2021 at 7:50:48 AM UTC+8, MRAB wrote:
> On 2021-12-30 23:27, hongy... at gmail.com wrote: 
> > 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? 
> >
> Walking a tree.

There are many type of trees. Do you mean all of them?


More information about the Python-list mailing list