This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Documentation for difflib uses optparse
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.6, Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: berker.peksag, docs@python, idahogray, python-dev, r.david.murray
Priority: normal Keywords: patch

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

File name Uploaded Description Edit
issue-24109.patch idahogray, 2015-05-02 15:50 Patch to include Tools/scripts/ 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.

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/  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/ 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/ instead of duplicating it in difflib documentation.

New changeset aa2517e9f9ce by Berker Peksag in branch 'default':
Issue #24109: Include Tools/scripts/ instead of duplicating it in difflib documentation.
msg247631 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-07-29 21:05
Thanks Keith.
Date User Action Args
2022-04-11 14:58:16adminsetgithub: 68297
2015-07-29 21:05:57berker.peksagsetstatus: open -> closed

versions: + Python 3.6
nosy: + berker.peksag

messages: + msg247631
resolution: fixed
stage: commit review -> resolved
2015-07-29 21:04:43python-devsetnosy: + python-dev
messages: + msg247630
2015-05-02 16:46:27r.david.murraysetversions: + Python 3.5, - Python 3.6
2015-05-02 16:46:22r.david.murraysetstage: commit review
messages: + msg242405
versions: - Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5
2015-05-02 15:50:38idahograysetfiles: + issue-24109.patch
keywords: + patch
messages: + msg242404
2015-05-02 15:21:24idahograysetmessages: + msg242402
2015-05-02 02:28:00r.david.murraysetnosy: + r.david.murray
messages: + msg242372
2015-05-01 19:38:50idahograycreate