diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-10-19 13:29:26 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-10-19 13:29:26 (GMT) |
commit | ecf41da83e5db98734b19f205899168cc56da943 (patch) | |
tree | e22e4354b5cc1e47d3781176a203037554eb3474 /Doc/library/optparse.rst | |
parent | 9f2e377beb4731c770f1383f2bae92fe1b8cc2e2 (diff) | |
download | cpython-ecf41da83e5db98734b19f205899168cc56da943.zip cpython-ecf41da83e5db98734b19f205899168cc56da943.tar.gz cpython-ecf41da83e5db98734b19f205899168cc56da943.tar.bz2 |
Issue #19795: Mark up None as literal text.
Diffstat (limited to 'Doc/library/optparse.rst')
-rw-r--r-- | Doc/library/optparse.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst index e5f40f4..2ef187d 100644 --- a/Doc/library/optparse.rst +++ b/Doc/library/optparse.rst @@ -2026,12 +2026,12 @@ Features of note: values.ensure_value(attr, value) - If the ``attr`` attribute of ``values`` doesn't exist or is None, then + If the ``attr`` attribute of ``values`` doesn't exist or is ``None``, then ensure_value() first sets it to ``value``, and then returns 'value. This is very handy for actions like ``"extend"``, ``"append"``, and ``"count"``, all of which accumulate data in a variable and expect that variable to be of a certain type (a list for the first two, an integer for the latter). Using :meth:`ensure_value` means that scripts using your action don't have to worry about setting a default value for the option destinations in question; they - can just leave the default as None and :meth:`ensure_value` will take care of + can just leave the default as ``None`` and :meth:`ensure_value` will take care of getting it right when it's needed. |