3 Apr
2009
3 Apr
'09
7:32 a.m.
Steven D'Aprano wrote:
Perhaps I've missed something, but it seems to me that the right limit to use would be the recursion limit, and the right exception to raise would be RecursionError rather than RuntimeError.
I'm not sure about that. The kind of code needed to cause a problem would be something like def i_refuse_to-die(): while 1: try: yield 42 except GeneratorExit: pass which looks more like a plain infinite loop than anything involving recursion, so I think getting a RecursionError would be more confusing than helpful. -- Greg