From 1dbd95c4bcb913ca6cf185b1a3a727b047e0c866 Mon Sep 17 00:00:00 2001 From: Sylvain Corlay Date: Sat, 21 Mar 2015 16:23:35 -0400 Subject: [PATCH 1/2] allow_none=False by default for Type and Instance --- IPython/html/notebookapp.py | 2 +- IPython/html/services/clusters/clustermanager.py | 2 +- IPython/html/widgets/widget.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/IPython/html/notebookapp.py b/IPython/html/notebookapp.py index 2641ca9e7..8a3a2213d 100644 --- a/IPython/html/notebookapp.py +++ b/IPython/html/notebookapp.py @@ -665,7 +665,7 @@ class NotebookApp(BaseIPythonApplication): help='The config manager class to use' ) - kernel_spec_manager = Instance(KernelSpecManager) + kernel_spec_manager = Instance(KernelSpecManager, allow_none=True) kernel_spec_manager_class = Type( default_value=KernelSpecManager, diff --git a/IPython/html/services/clusters/clustermanager.py b/IPython/html/services/clusters/clustermanager.py index c0a877613..f42827399 100644 --- a/IPython/html/services/clusters/clustermanager.py +++ b/IPython/html/services/clusters/clustermanager.py @@ -20,7 +20,7 @@ class ClusterManager(LoggingConfigurable): delay = Float(1., config=True, help="delay (in s) between starting the controller and the engines") - loop = Instance('zmq.eventloop.ioloop.IOLoop') + loop = Instance('zmq.eventloop.ioloop.IOLoop', allow_none=True) def _loop_default(self): from zmq.eventloop.ioloop import IOLoop return IOLoop.instance() diff --git a/IPython/html/widgets/widget.py b/IPython/html/widgets/widget.py index 417acd714..5c9ec6106 100644 --- a/IPython/html/widgets/widget.py +++ b/IPython/html/widgets/widget.py @@ -129,7 +129,7 @@ class Widget(LoggingConfigurable): If empty, look in the global registry.""", sync=True) _view_name = Unicode(None, allow_none=True, help="""Default view registered in the front-end to use to represent the widget.""", sync=True) - comm = Instance('IPython.kernel.comm.Comm') + comm = Instance('IPython.kernel.comm.Comm', allow_none=True) msg_throttle = Int(3, sync=True, help="""Maximum number of msgs the front-end can send before receiving an idle msg from the back-end.""") From fa1fce83db79d1c4914d2f2440f038474e223b92 Mon Sep 17 00:00:00 2001 From: Sylvain Corlay Date: Fri, 27 Mar 2015 20:00:47 -0400 Subject: [PATCH 2/2] remove unnecessary allow_none=True --- IPython/html/services/clusters/clustermanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IPython/html/services/clusters/clustermanager.py b/IPython/html/services/clusters/clustermanager.py index f42827399..c0a877613 100644 --- a/IPython/html/services/clusters/clustermanager.py +++ b/IPython/html/services/clusters/clustermanager.py @@ -20,7 +20,7 @@ class ClusterManager(LoggingConfigurable): delay = Float(1., config=True, help="delay (in s) between starting the controller and the engines") - loop = Instance('zmq.eventloop.ioloop.IOLoop', allow_none=True) + loop = Instance('zmq.eventloop.ioloop.IOLoop') def _loop_default(self): from zmq.eventloop.ioloop import IOLoop return IOLoop.instance()