Default values are ignored by `magic_factory`
See original GitHub issueDescribe the bug
from magicgui import magic_factory
@magic_factory
def factory(arg=None):
...
factory()()
This fails with
TypeError: missing a required argument: 'arg' in call to 'factory(arg)'.
To avoid this error, you can bind a value or callback to the parameter:
factory.arg.bind(value)
Or use the 'bind' option in the magicgui decorator:
@magicgui(arg={'bind': value})
def factory(arg): ...
Indeed, this can be circumvented by adding arg={'bind': None} to the magic_factory call, but this is different from the bahviour of @magicgui.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Set default values for blank fields in Zaps - Zapier
2. Set up the Default Value text transform. Click the Transform dropdown menu and select Default Value. Click the Input field and select...
Read more >Jackson serialization: ignore empty values (or null)
I'm currently using jackson 2.1. 4 and I'm having some trouble ignoring fields when I'm converting an object to a JSON string. How...
Read more >"switch" statements should have "default" clauses
The requirement for a final default clause is defensive programming. The clause should either take appropriate action, or contain a suitable comment as...
Read more >magicgui - PyPI
build GUIs from functions, using magic. ... Fix default value of None being ignored #244 (tlambert03); Fix reuse of magic factory #224 (tlambert03) ......
Read more >MUnit Test Structure Fundamentals | MuleSoft Documentation
The default value for the ignore attribute is false . In Anypoint Studio, you can check the Ignore Test option. ignore-test.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

ancient history!! 😃
different, will take a look.