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.

Author Claudiu.Popa
Recipients Claudiu.Popa
Date 2014-03-22.20:44:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1395521056.07.0.611061866436.issue21027@psf.upfronthosting.co.za>
In-reply-to
Content
Hello!

The attached patch proposes a new command line interface to difflib module.
Currently, `python -m difflib` does nothing useful, it runs the doc suite for the difflib module.
Right now, there are a couple of modules in the standard lib, which provides
helpful cli interfaces. For instance, inspect for analyzing an object, compileall for compilation of Python files
or json.tool for validating and pretty printing JSON. Also, in Tools/scripts/ there is a small utility called diff.py,
which uses difflib to implement a simple diff like utility, but the following issue proposes its deprecation
and I'll enumerate my reasons for this:

- On Windows, py -3 -m difflib is easier to use. Yes, Tools/Scripts can be added to PATH, so that diff.py can be used there, but we can't do always that. I have at work a couple of machines where I can't modify the PATH due to user limitations. Having `py -3 -m difflib` as a handy diff tool is invaluable on such systems.

- Continuing the same argument as above, you can't always install a proper diff tool, due to same limitations. Having a simple one builtin in the stdlib is more than useful! Also, you can't always use a versioning system, in order to use its diff feature.

- Tools/Scripts/diff.py is not tested at all.

- diff.py was added before the `-m` thingy came, now `-m difflib` is the more natural way and I hope to see even more modules providing it with useful cli interfaces, like compileall or inspect.

Thanks in advance!
History
Date User Action Args
2014-03-22 20:44:16Claudiu.Popasetrecipients: + Claudiu.Popa
2014-03-22 20:44:16Claudiu.Popasetmessageid: <1395521056.07.0.611061866436.issue21027@psf.upfronthosting.co.za>
2014-03-22 20:44:16Claudiu.Popalinkissue21027 messages
2014-03-22 20:44:15Claudiu.Popacreate