[issue30617] IDLE: Add docstrings and unittests to outwin.py
Cheryl Sabella
report at bugs.python.org
Mon Jun 12 10:44:05 EDT 2017
Cheryl Sabella added the comment:
Thanks!
I've added more unittests. They are passing, but I'm getting a callback error that I don't understand. The same _utest flag that's on the textview dialog didn't seem to work and I was just blindly trying things without success. Also, the window is briefly opening and closing on the screen. Any suggestions on where I should look next?
B3 below. Thanks for the link to that other message. Combining that with some comments on SO, I tried to find unicode that would be selected by \d and would fail with int(), but couldn't find any. However, I also realized that the try/except is checking for a TypeError and not a ValueError. I went and looked at the change history for OutputWindow, but couldn't see anything that would show why there might be a TypeError check here. If the match group is None, it wouldn't get this far in the code.
Additionally,
1. I removed 'from tkinter import *' because it wasn't being used.
2. I changed 'import tkinter.messagebox as tkMessageBox' per issue 30422.
3. There were two lines:
edit = self.flist.open(filename)
edit.gotoline(lineno)
but flist had a gotofileline() that did the same thing. In the historical code, the 'edit = ' line had and 'or', so maybe that's why it was separated.
4. *args on the __init__. I've seen *args used for passing config options and things like that, but I don't understand why it would be preferable here instead of listing the 4 arguments explicitly.
Thanks!
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30617>
_______________________________________
More information about the Python-bugs-list
mailing list