[issue11343] Make errors due to full parser stack identifiable

Nick Coghlan report at bugs.python.org
Sat Jul 16 17:53:45 CEST 2011


Nick Coghlan <ncoghlan at gmail.com> added the comment:

It matters, because Python "users" are programmers, and most
programmers want to know *why* they're being told something is wrong.
Raising MemoryError is technically incorrect at this point, but at
least gives the right flavour of the user not doing anything
specifically wrong, the program just ran out of resources trying to do
as they asked. I see SyntaxError as significantly worse, however, as
instead of telling the developer "sorry, that's a reasonable request,
but I can't handle it", the interpreter is now telling them "you did
that wrong, change it". The semantics of that are all wrong. There's
nothing wrong with the syntax of the user's code, it's just that the
compiler can't handle it.

Similarly, the eventual fix to the recursive crash in the compiler
itself is likely to be an arbitrary limit on expression nesting.
Again, nothing wrong with their syntax, but they'll need to adjust
their (legal!) code to work around implementation limitations.

----------

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


More information about the Python-bugs-list mailing list