From da6f284cf1ffa1397c32167e1e23189ea29e5b2f 2014-07-17 20:07:37 From: Jason Grout Date: 2014-07-17 20:07:37 Subject: [PATCH] Make Container widgets take children as the first positional argument This makes creating containers less cumbersome: Container([list, of, children]), rather than Container(children=[list, of, children]) --- diff --git a/IPython/html/widgets/widget_container.py b/IPython/html/widgets/widget_container.py index dce2a2f..74b96d5 100644 --- a/IPython/html/widgets/widget_container.py +++ b/IPython/html/widgets/widget_container.py @@ -17,7 +17,8 @@ class ContainerWidget(DOMWidget): # When a proper notifying-list trait exists, that is what should be used here. children = Tuple(sync=True) - def __init__(self, **kwargs): + def __init__(self, children = None, **kwargs): + kwargs['children'] = children super(ContainerWidget, self).__init__(**kwargs) self.on_displayed(ContainerWidget._fire_children_displayed)