Terry J. Reedy <tjre...@udel.edu> added the comment:

I retract my original comment as I now agree with SyntaxError + distinct 
message.

Given Irit's report, I think the remaining question is whether 

A. The implication that 'too many nested parentheses' is compiler specific is 
strong enough, and any thing further should be left to 3rd parties to explain, 
and this issue should be closed as 'out of date'.

B. We should be explicit and add something like 'for this compiler'.

Since Pablo has been working on improving error messages, I would give his 
opinion high weight.

To find the actual limit, I did the following with Win 10, 3.10.0b3, IDLE:

>>> def f(n):
...     print(eval('('*n + ')'*n"))
... 
And after some trials, found
>>> f(200)
()
>>> f(201)
Traceback (most recent call last):
  File "<pyshell#56>", line 1, in <module>
    f(201)
  File "<pyshell#42>", line 2, in f
    print(eval('('*n + ')'*n))
  File "<string>", line 1
    
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((()))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
        ^
SyntaxError: too many nested parentheses

The error is detected in 'string' line 1, 1-based offset 201, at the final '('. 
 There are 200 spaces before the caret but they are not obvious in this box, 
which does not wrap spaces properly. The end_lineno and end_offset are None, 
None rather than the 1,202 I expected.

----------
nosy: +aroberge, pablogsal
stage: patch review -> needs patch
versions: +Python 3.11 -Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue11343>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to