##// END OF EJS Templates
remove dict() function call and replace it with dict literal - {}
Srinivas Reddy Thatiparthy -
Show More
@@ -1139,7 +1139,7 b' class InteractiveShell(SingletonConfigurable):'
1139
1139
1140 # For more details:
1140 # For more details:
1141 # http://mail.python.org/pipermail/python-dev/2001-April/014068.html
1141 # http://mail.python.org/pipermail/python-dev/2001-April/014068.html
1142 ns = dict()
1142 ns = {}
1143
1143
1144 # make global variables for user access to the histories
1144 # make global variables for user access to the histories
1145 ns['_ih'] = self.history_manager.input_hist_parsed
1145 ns['_ih'] = self.history_manager.input_hist_parsed
@@ -1367,7 +1367,7 b' class InteractiveShell(SingletonConfigurable):'
1367 if not oname.startswith(ESC_MAGIC) and \
1367 if not oname.startswith(ESC_MAGIC) and \
1368 not oname.startswith(ESC_MAGIC2) and \
1368 not oname.startswith(ESC_MAGIC2) and \
1369 not py3compat.isidentifier(oname, dotted=True):
1369 not py3compat.isidentifier(oname, dotted=True):
1370 return dict(found=False)
1370 return {'found': False}
1371
1371
1372 if namespaces is None:
1372 if namespaces is None:
1373 # Namespaces to search in:
1373 # Namespaces to search in:
@@ -109,13 +109,13 b" def print_figure(fig, fmt='png', bbox_inches='tight', **kwargs):"
109 fmt = 'png'
109 fmt = 'png'
110
110
111 # build keyword args
111 # build keyword args
112 kw = dict(
112 kw = {
113 format=fmt,
113 "format":fmt,
114 facecolor=fig.get_facecolor(),
114 "facecolor":fig.get_facecolor(),
115 edgecolor=fig.get_edgecolor(),
115 "edgecolor":fig.get_edgecolor(),
116 dpi=dpi,
116 "dpi":dpi,
117 bbox_inches=bbox_inches,
117 "bbox_inches":bbox_inches,
118 )
118 }
119 # **kwargs get higher priority
119 # **kwargs get higher priority
120 kw.update(kwargs)
120 kw.update(kwargs)
121
121
@@ -134,7 +134,7 b' def retina_figure(fig, **kwargs):'
134 if pngdata is None:
134 if pngdata is None:
135 return
135 return
136 w, h = _pngxy(pngdata)
136 w, h = _pngxy(pngdata)
137 metadata = dict(width=w//2, height=h//2)
137 metadata = {"width": w//2, "height":h//2}
138 return pngdata, metadata
138 return pngdata, metadata
139
139
140 # We need a little factory function here to create the closure where
140 # We need a little factory function here to create the closure where
@@ -383,7 +383,7 b' def configure_inline_support(shell, backend):'
383 shell.events.register('post_execute', flush_figures)
383 shell.events.register('post_execute', flush_figures)
384
384
385 # Save rcParams that will be overwrittern
385 # Save rcParams that will be overwrittern
386 shell._saved_rcParams = dict()
386 shell._saved_rcParams = {}
387 for k in cfg.rc:
387 for k in cfg.rc:
388 shell._saved_rcParams[k] = matplotlib.rcParams[k]
388 shell._saved_rcParams[k] = matplotlib.rcParams[k]
389 # load inline_rc
389 # load inline_rc
@@ -1162,7 +1162,7 b' array([[ inf, nan, 2., 3.],'
1162
1162
1163 #ipython_directive.DEBUG = True # dbg
1163 #ipython_directive.DEBUG = True # dbg
1164 #options = dict(suppress=True) # dbg
1164 #options = dict(suppress=True) # dbg
1165 options = dict()
1165 options = {}
1166 for example in examples:
1166 for example in examples:
1167 content = example.split('\n')
1167 content = example.split('\n')
1168 IPythonDirective('debug', arguments=None, options=options,
1168 IPythonDirective('debug', arguments=None, options=options,
@@ -39,7 +39,7 b' def multi_filter_str(flt):'
39 yield name(flt)
39 yield name(flt)
40
40
41
41
42 log_filters = dict(_AndList='And', _OrList='Or')
42 log_filters = {'_AndList': 'And', '_OrList': 'Or'}
43 log_invert = {'_Invert'}
43 log_invert = {'_Invert'}
44
44
45 kbm = KeyBindingManager.for_prompt()
45 kbm = KeyBindingManager.for_prompt()
@@ -53,8 +53,8 b' if common_docs:'
53
53
54 dummy_docs = list(set(dummy_docs))
54 dummy_docs = list(set(dummy_docs))
55
55
56 single_filter = dict()
56 single_filter = {}
57 multi_filter = dict()
57 multi_filter = {}
58 for kb in ipy_bindings:
58 for kb in ipy_bindings:
59 doc = kb.handler.__doc__
59 doc = kb.handler.__doc__
60 if not doc or doc in dummy_docs:
60 if not doc or doc in dummy_docs:
General Comments 0
You need to be logged in to leave comments. Login now