Author terry.reedy
Recipients cheryl.sabella, louielu, terry.reedy
Date 2017-06-21.23:36:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1498088215.04.0.812004436002.issue30728@psf.upfronthosting.co.za>
In-reply-to
Content
Depending on the file, modernizing includes:
* Add docstrings.
* Change non-class names with caps to PEP8 no-caps names;
  this often means, for example, changing embedded 'A' to '_a'.
* Make most comments be sentences, like this sentence.  
* Review and possibly change overly cryptic existing PEP8 names.
* Switch to ttk widgets and revise imports; 'from tkinter import *'
  becomes 'from tkinter(.ttk) import item1, item2, ...';
  use (...\n...) for multiple lines.
* Split a toplevel class into a window class and a frame class.
* Use modern code idioms and features up to current maintenance version.
* Add tests, which are essential for checking correctness of above.

For a large file like configdialog.py, I would like a separate PR or even issue for each item above.  Of necessity, name changes must be done  in test_configdialog.py, and it should be included in most patches for this issue.  For some files, other consumers will also need patching. I don't think that modules other than test_configdialog access much of anything beside ConfigDialog, which name we are not presently changing. 

Cheryl's original patch for this issue combined conversion to pep8 names, revision of pep8 names (including existing #28523 'colour' to 'color'), and tkk and import conversion (and an unrelated typo correction in another file).  Louie suggested adding comment revisions.  At this point, I decided that this would be too much for one patch and that I would prefer more numerous patches that would be easier to review and test.  (Louie's comments should be the basis for a separate PR.) Issue 28523 can be made a dependency of this issue and expanded to other name revisions.

The order of changes is somewhat arbitrary, except that docstrings and comments do not need tests, and can be helpful for writing tests.  Tests of some type are otherwise needed for the other steps.  This presents a problem when code changes are needed to write tests. What is true is that each patch needs to apply to the current file, and once applied, should be backported immediately.  (Out of order backports can 'work' but produce a wrong result.  This happened already.)

The problem of multiple patches to the same file possibly breaking each other includes exist patches on the tracker.  When we changed textview, there were no outstanding patches that I know of.  For help_about, there is an existing patch, but I did not want to apply it completely as is.  Pieces of it will have to be adapted as needed.  For config_key, there are at least 2 patches that may be ready-to-go or close to it.  So I want to test those before writing additional patches to modernize config_key.

I will review current config-dialog issues to see which have patches and which might be quick to apply.
History
Date User Action Args
2017-06-21 23:36:55terry.reedysetrecipients: + terry.reedy, louielu, cheryl.sabella
2017-06-21 23:36:55terry.reedysetmessageid: <1498088215.04.0.812004436002.issue30728@psf.upfronthosting.co.za>
2017-06-21 23:36:55terry.reedylinkissue30728 messages
2017-06-21 23:36:54terry.reedycreate