We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4189af4 commit 12c254eCopy full SHA for 12c254e
python/private/builders.bzl
@@ -185,8 +185,20 @@ def _is_runfiles(value):
185
return type(value) == "runfiles"
186
187
def _Optional(*initial):
188
+ """A wrapper for a re-assignable value that may or may not be set.
189
+
190
+ This allows structs to have attributes that aren't inherently mutable
191
+ and must be re-assigned to have their value updated.
192
193
+ Args:
194
+ *initial: A single vararg to be the initial value, or no args
195
+ to leave it unset.
196
197
+ Returns:
198
+ {type}`Optional`
199
+ """
200
if len(initial) > 1:
- fail("only one positional arg allowed")
201
+ fail("Only zero or one positional arg allowed")
202
203
# buildifier: disable=uninitialized
204
self = struct(
0 commit comments