[issue11343] Make errors due to full parser stack identifiable

Benjamin Peterson report at bugs.python.org
Sat Jul 16 16:43:35 CEST 2011


Benjamin Peterson <benjamin at python.org> added the comment:

2011/7/16 Nick Coghlan <report at bugs.python.org>:
>
> Nick Coghlan <ncoghlan at gmail.com> added the comment:
>
> +1 for a new exception type to indicate "this may technically be legal Python, but this Python implementation cannot handle it correctly"
>
> Whatever exception type we add, it would be nice to also be able to use it if someone eventually fixes the compiler recursion crasher, so I'd like to paint this particular bikeshed as the more general "SyntaxLimitError".

What is the point of a new exception? When would you ever want to
catch it as opposed to a regular SyntaxError? You're going to have to
change the code either way.

Moreover, all Python implementations are going to have to place some
limits on stack depth and recursion, so it's not really an
implementation detail.

The Python language doesn't make an mention of limited memory, but no
one is going to suggest a MemoryLimitError, which is an
"implementation detail".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11343>
_______________________________________


More information about the Python-bugs-list mailing list