summaryrefslogtreecommitdiffstats
path: root/Doc/library/difflib.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-04-10 09:03:43 (GMT)
committerGeorg Brandl <georg@python.org>2009-04-10 09:03:43 (GMT)
commitc2a4f4fb67a76cb04731beebc515878f9b91674c (patch)
tree35fe3ee01b0b32931f4beb11ebcc4553d0f34f3a /Doc/library/difflib.rst
parent388faac8cb5be6ad1ad474bae237b71bd00a1900 (diff)
downloadcpython-c2a4f4fb67a76cb04731beebc515878f9b91674c.zip
cpython-c2a4f4fb67a76cb04731beebc515878f9b91674c.tar.gz
cpython-c2a4f4fb67a76cb04731beebc515878f9b91674c.tar.bz2
Update signature style for optional arguments, part 3.
Diffstat (limited to 'Doc/library/difflib.rst')
-rw-r--r--Doc/library/difflib.rst22
1 files changed, 10 insertions, 12 deletions
diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst
index 00f273e..292c0ce 100644
--- a/Doc/library/difflib.rst
+++ b/Doc/library/difflib.rst
@@ -72,7 +72,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
The constructor for this class is:
- .. function:: __init__([tabsize][, wrapcolumn][, linejunk][, charjunk])
+ .. method:: __init__(tabsize=8, wrapcolumn=None, linejunk=None, charjunk=IS_CHARACTER_JUNK)
Initializes instance of :class:`HtmlDiff`.
@@ -88,8 +88,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
The following methods are public:
-
- .. function:: make_file(fromlines, tolines [, fromdesc][, todesc][, context][, numlines])
+ .. method:: make_file(fromlines, tolines, fromdesc='', todesc='', context=False, numlines=5)
Compares *fromlines* and *tolines* (lists of strings) and returns a string which
is a complete HTML file containing a table showing line by line differences with
@@ -108,8 +107,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
the next difference highlight at the top of the browser without any leading
context).
-
- .. function:: make_table(fromlines, tolines [, fromdesc][, todesc][, context][, numlines])
+ .. method:: make_table(fromlines, tolines, fromdesc='', todesc='', context=False, numlines=5)
Compares *fromlines* and *tolines* (lists of strings) and returns a string which
is a complete HTML table showing line by line differences with inter-line and
@@ -122,7 +120,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
contains a good example of its use.
-.. function:: context_diff(a, b[, fromfile][, tofile][, fromfiledate][, tofiledate][, n][, lineterm])
+.. function:: context_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\\n')
Compare *a* and *b* (lists of strings); return a delta (a :term:`generator`
generating the delta lines) in context diff format.
@@ -167,7 +165,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
See :ref:`difflib-interface` for a more detailed example.
-.. function:: get_close_matches(word, possibilities[, n][, cutoff])
+.. function:: get_close_matches(word, possibilities, n=3, cutoff=0.6)
Return a list of the best "good enough" matches. *word* is a sequence for which
close matches are desired (typically a string), and *possibilities* is a list of
@@ -193,7 +191,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
['except']
-.. function:: ndiff(a, b[, linejunk][, charjunk])
+.. function:: ndiff(a, b, linejunk=None, charjunk=IS_CHARACTER_JUNK)
Compare *a* and *b* (lists of strings); return a :class:`Differ`\ -style
delta (a :term:`generator` generating the delta lines).
@@ -253,7 +251,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
emu
-.. function:: unified_diff(a, b[, fromfile][, tofile][, fromfiledate][, tofiledate][, n][, lineterm])
+.. function:: unified_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\\n')
Compare *a* and *b* (lists of strings); return a delta (a :term:`generator`
generating the delta lines) in unified diff format.
@@ -326,7 +324,7 @@ SequenceMatcher Objects
The :class:`SequenceMatcher` class has this constructor:
-.. class:: SequenceMatcher([isjunk[, a[, b]]])
+.. class:: SequenceMatcher(isjunk=None, a='', b='')
Optional argument *isjunk* must be ``None`` (the default) or a one-argument
function that takes a sequence element and returns true if and only if the
@@ -467,7 +465,7 @@ The :class:`SequenceMatcher` class has this constructor:
insert a[6:6] () b[5:6] (f)
- .. method:: get_grouped_opcodes([n])
+ .. method:: get_grouped_opcodes(n=3)
Return a :term:`generator` of groups with up to *n* lines of context.
@@ -580,7 +578,7 @@ locality, at the occasional cost of producing a longer diff.
The :class:`Differ` class has this constructor:
-.. class:: Differ([linejunk[, charjunk]])
+.. class:: Differ(linejunk=None, charjunk=None)
Optional keyword parameters *linejunk* and *charjunk* are for filter functions
(or ``None``):