You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: nbs/06_script.ipynb
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,22 @@
92
92
"You should provide a default (after the `=`) for any *optional* parameters. If you don't provide a default for a parameter, then it will be a *positional* parameter."
93
93
]
94
94
},
95
+
{
96
+
"cell_type": "markdown",
97
+
"metadata": {},
98
+
"source": [
99
+
"::: {.callout-warning}\n",
100
+
"## Boolean Arguments Default to False\n",
101
+
"Arguments of type `bool` or `store_true` default to `False` regardless of whether you provide a default or not. Use `bool_arg` as the type instead of `bool` if you want to set a default value of True. For example:\n",
102
+
"\n",
103
+
"```python\n",
104
+
"@call_parse\n",
105
+
"def main(msg:str=\"Hi\", # The message\n",
106
+
" upper:bool_arg=True): # Convert to uppercase?\n",
0 commit comments