##// END OF EJS Templates
Use traitlet on InteractiveShellApp instead of storing user_ns via __init__
Thomas Kluyver -
Show More
@@ -34,7 +34,7 b' from IPython.utils import py3compat'
34 from IPython.utils.contexts import preserve_keys
34 from IPython.utils.contexts import preserve_keys
35 from IPython.utils.path import filefind
35 from IPython.utils.path import filefind
36 from IPython.utils.traitlets import (
36 from IPython.utils.traitlets import (
37 Unicode, Instance, List, Bool, CaselessStrEnum
37 Unicode, Instance, List, Bool, CaselessStrEnum, Dict
38 )
38 )
39
39
40 #-----------------------------------------------------------------------------
40 #-----------------------------------------------------------------------------
@@ -198,9 +198,11 b' class InteractiveShellApp(Configurable):'
198 )
198 )
199 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
199 shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
200
200
201 def __init__(self, user_ns=None, **kwargs):
201 user_ns = Dict(default_value=None)
202 self.user_ns = user_ns
202 def _user_ns_changed(self, name, old, new):
203 super(InteractiveShellApp, self).__init__(**kwargs)
203 if self.shell is not None:
204 self.shell.user_ns = new
205 self.shell.init_user_ns()
204
206
205 def init_path(self):
207 def init_path(self):
206 """Add current working directory, '', to sys.path"""
208 """Add current working directory, '', to sys.path"""
General Comments 0
You need to be logged in to leave comments. Login now