Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions nbs/06_script.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@
"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."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"::: {.callout-warning}\n",
"## Boolean Arguments Default to False\n",
"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",
"\n",
"```python\n",
"@call_parse\n",
"def main(msg:str=\"Hi\", # The message\n",
" upper:bool_arg=True): # Convert to uppercase?\n",
"```\n",
":::"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down