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

The baseline for what should happen is what does happen in interactive 
python.exe.

>>> class N:
...   def __repr__(self): raise ValueError
...
>>> N()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in __repr__
ValueError

IDLE's Shell very intentionally improves on this by including the code, which 
would be present if one ran the code from a file.  This is most definitely not 
a bug.

idlelib.run.cleanup_traceback removes internal items from the beginning and end 
of tracebacks (as long as something is left) but intentionally leaves them in 
the middle, as they may add useful information.  (Situations like this are 
rare.)  This is also not a bug.  These details are not part of the language 
definition.

In this case, I think the extra line will on net be informative to beginners.  
But even if you disagree, there is no way for code to decide.  I cannot imagine 
what else you think is 'wrong'.

----------

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

Reply via email to