diff -r e961688ae714 -r 8d612ccff747 Doc/library/optparse.rst --- a/Doc/library/optparse.rst Fri Oct 01 17:40:20 2010 +0200 +++ b/Doc/library/optparse.rst Fri Oct 01 20:17:25 2010 +0200 @@ -1088,6 +1088,14 @@ options.tracks.append(int("4")) + An interesting behaviour to note is what happens when there is a default + value: any option passed on the command-line is `appended` to the + :attr:`~Option.dest` variable, that already contains the default value; it + means that the default value is preserved in case of additional options and + not replaced (contrary to what one can think). This behaviour is clear if you + think that with a default value :attr:`~Option.dest` is a list containing one + element (the default) and any additional option is appended to that list. + * ``"append_const"`` [required: :attr:`~Option.const`; relevant: :attr:`~Option.dest`]