Skip to content

Commit a7f4ab1

Browse files
committed
Small docstring update for vars.Add
Signed-off-by: Mats Wichmann <[email protected]>
1 parent 91b6bcc commit a7f4ab1

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

SCons/Variables/__init__.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ def _do_add(
135135
option.default = default
136136
option.validator = validator
137137
option.converter = converter
138-
option.do_subst = kwargs.get("subst", True)
138+
option.do_subst = kwargs.pop("subst", True)
139+
# TODO should any remaining kwargs be saved in the Variable?
139140

140141
self.options.append(option)
141142

@@ -158,21 +159,26 @@ def Add(
158159
Arguments:
159160
key: the name of the variable, or a 5-tuple (or list).
160161
If *key* is a tuple, and there are no additional positional
161-
arguments, it is unpacked into the variable name plus the four
162-
listed keyword arguments from below.
162+
arguments, it is unpacked into the variable name plus the
163+
*help*, *default*, *validator* and *converter keyword args.
163164
If *key* is a tuple and there are additional positional arguments,
164165
the first word of the tuple is taken as the variable name,
165166
and the remainder as aliases.
166-
args: optional positional arguments, corresponding to the four
167-
listed keyword arguments.
167+
args: optional positional arguments, corresponding to the
168+
*help*, *default*, *validator* and *converter keyword args.
168169
kwargs: arbitrary keyword arguments used by the variable itself.
169170
170171
Keyword Args:
171-
help: help text for the variable (default: ``""``)
172+
help: help text for the variable (default: empty string)
172173
default: default value for variable (default: ``None``)
173174
validator: function called to validate the value (default: ``None``)
174175
converter: function to be called to convert the variable's
175176
value before putting it in the environment. (default: ``None``)
177+
subst: if true perform substitution on the value before the converter
178+
and validator functions (if any) are called (default: ``True``)
179+
180+
.. versionadded:: 4.8.0
181+
The *subst* keyword argument is now specially recognized.
176182
"""
177183
if SCons.Util.is_Sequence(key):
178184
# If no other positional args (and no fundamental kwargs),

0 commit comments

Comments
 (0)