diff -r e961688ae714 -r 1ca88e24f267 Doc/library/optparse.rst --- a/Doc/library/optparse.rst Fri Oct 01 17:40:20 2010 +0200 +++ b/Doc/library/optparse.rst Mon Oct 04 19:27:05 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, which 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 makes sense if + you think that with a default value, :attr:`~Option.dest` is a list containing + one element (the default) and any additional value is appended to that list. + * ``"append_const"`` [required: :attr:`~Option.const`; relevant: :attr:`~Option.dest`]