[Python-checkins] [3.10] GH-101111: Disambigaute origin of const for store_const and append_const (GH-101121) (#101204)

ambv webhook-mailer at python.org
Fri Jan 20 17:22:27 EST 2023


https://github.com/python/cpython/commit/f1313ab97932ffdda2868f59e54c98483d37e489
commit: f1313ab97932ffdda2868f59e54c98483d37e489
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2023年01月20日T23:22:21+01:00
summary:
[3.10] GH-101111: Disambigaute origin of const for store_const and append_const (GH-101121) (#101204)
(cherry picked from commit 9a155138c58cad409e28e34359ba87ec0025b6b7)
While the documentation for `optparse` mentioned that both `store_const` and
`append_const` store a constant value, it was not clear where this value was
coming from.
A link to `Option.const` makes this explicit.
Co-authored-by: Jürgen Gmach <juergen.gmach at googlemail.com>
files:
M Doc/library/optparse.rst
diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst
index 47e62553fb03..3e29fed0175e 100644
--- a/Doc/library/optparse.rst
+++ b/Doc/library/optparse.rst
@@ -404,7 +404,7 @@ Other actions
 Some other actions supported by :mod:`optparse` are:
 
 ``"store_const"``
- store a constant value
+ store a constant value, pre-set via :attr:`Option.const`
 
 ``"append"``
 append this option's argument to a list
@@ -925,7 +925,7 @@ The canonical way to create an :class:`Option` instance is with the
 store this option's argument (default)
 
 ``"store_const"``
- store a constant value
+ store a constant value, pre-set via :attr:`Option.const`
 
 ``"store_true"``
 store ``True``
@@ -937,7 +937,7 @@ The canonical way to create an :class:`Option` instance is with the
 append this option's argument to a list
 
 ``"append_const"``
- append a constant value to a list
+ append a constant value to a list, pre-set via :attr:`Option.const`
 
 ``"count"``
 increment a counter by one


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /