ScriptEditor call stack: what is the repeating doc(self)?

I set a breakpoint on a line, executed a script, and the call stack shows a stack of stacks, all starting with doc(self).

If I click on the doc(self) lline, I don’t see any variables. If I click on any of the other lines, I do see some variable values, but… they don’t make any sense… what do they refer to?

I would expect to see only one call stack. I think the one at the top, all the lines above the first doc(). I don’t understand why there are so many call stacks.

If I attach the PyCharm debugger, I only see one frame, which is what I was expecting.

Here is the stack of stacks:


PS
As a side note, yes, it is possible to use PyCharm or VSCode as Rhino’s debugger, perhaps I will reply to this post with the instructions.

Here is the debug panel in PyCharm when stopping at the same breakpoint: