Issue 24109: Documentation for difflib uses optparse (original) (raw)

Created on 2015-05-01 19:38 by idahogray, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue-24109.patch idahogray,2015-05-02 15:50 Patch to include Tools/scripts/diff.py in the difflib documentation review
Messages (7)
msg242347 - (view) Author: Keith Gray (idahogray) Date: 2015-05-01 19:38
The documentation for optparse states it has been deprecated in favor of argparse since 2.7. However, the library documentation for difflib still uses optparse in the example. https://docs.python.org/2/library/difflib.html#a-command-line-interface-to-difflib https://docs.python.org/3.5/library/difflib.html#a-command-line-interface-to-difflib I am willing to update the documentation if there is agreement that it is needed.
msg242372 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-05-02 02:27
It wouldn't be a bad idea. Of course, you'd also need to update Tools/script/diff.py. Tests should be added as well, since we have started adding tests for things in Tools. The tests should be written first, to make sure that the behavior of 'diff' does not change, since I know there are people actively using it (on Windows). I think it would also be a good idea to change the docs so that the actual diff script is embedded in the docs (sphinx has a directive for doing that), rather that duplicating the code.
msg242402 - (view) Author: Keith Gray (idahogray) Date: 2015-05-02 15:21
I took a look at Tools/scripts/diff.py and it looks like it got converted to use argparse 9 months ago. I think I should be able to just include that in the difflib documentation directly. My next question is which branches need to have this changed? Do I just make the documentation change to the default branch or do I need to change it in 2.7, 3.2, 3.3, and 3.4 as well?
msg242404 - (view) Author: Keith Gray (idahogray) Date: 2015-05-02 15:50
Here is the patch. I have tested it against tip. Let me know if you need anything else.
msg242405 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-05-02 16:46
Since the Tools script was only changed in 3.5 (I was looking at the wrong branch), I think the docs should only be changed for 3.5.
msg247630 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-07-29 21:04
New changeset 8777e59a99bd by Berker Peksag in branch '3.5': Issue #24109: Include Tools/scripts/diff.py instead of duplicating it in difflib documentation. https://hg.python.org/cpython/rev/8777e59a99bd New changeset aa2517e9f9ce by Berker Peksag in branch 'default': Issue #24109: Include Tools/scripts/diff.py instead of duplicating it in difflib documentation. https://hg.python.org/cpython/rev/aa2517e9f9ce
msg247631 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-07-29 21:05
Thanks Keith.
History
Date User Action Args
2022-04-11 14:58:16 admin set github: 68297
2015-07-29 21:05:57 berker.peksag set status: open -> closedversions: + Python 3.6nosy: + berker.peksagmessages: + resolution: fixedstage: commit review -> resolved
2015-07-29 21:04:43 python-dev set nosy: + python-devmessages: +
2015-05-02 16:46:27 r.david.murray set versions: + Python 3.5, - Python 3.6
2015-05-02 16:46:22 r.david.murray set stage: commit reviewmessages: + versions: - Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5
2015-05-02 15:50:38 idahogray set files: + issue-24109.patchkeywords: + patchmessages: +
2015-05-02 15:21:24 idahogray set messages: +
2015-05-02 02:28:00 r.david.murray set nosy: + r.david.murraymessages: +
2015-05-01 19:38:50 idahogray create