builtins.TypeError: catching classes that do not inherit from BaseException is not allowed
MRAB
python at mrabarnett.plus.com
Thu Dec 30 18:50:20 EST 2021
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.
More information about the Python-list
mailing list