[docs] In difflib module name of the parameters for *_diff methods can be descriptive

Sateesh Kumar sateeshpyper at gmail.com
Tue Jul 10 09:43:09 CEST 2012


In the 'difflib' module the signature of the method context_diff is as below:

difflib.context_diff(a, b[, fromfile][, tofile][, fromfiledate][,
tofiledate][, n][, lineterm])

As per the documentation 'fromfile' and 'tofile' are used as names of
the headers
in the report generated.It is expected that the user specifies
names of the files as arguments for optional parameters 'fromfile' and
'tofile'. But name of the parameter 'fromfile' ('tofile') is bit confusing
as it doesn't give a clear indication that what is expected is a name of a file
(and not a fileobject). So it is better to rename these parameters
as 'fromfilename' and 'tofilename' which will also be in sync with
other parameter names ('fromfiledate','tofiledate').

Similar change can be done in method 'difflib.unified_diff'.

I am referring to documentation of this module in Python 2.7.3
http://docs.python.org/library/difflib.html


thanks,
sateesh


More information about the docs mailing list