Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d14df73

Browse files
committed
Dict litteral
1 parent 058dda2 commit d14df73

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

IPython/core/interactiveshell.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -804,11 +804,10 @@ def save_sys_module_state(self):
804804
805805
This has to be called after self.user_module is created.
806806
"""
807-
self._orig_sys_module_state = {}
808-
self._orig_sys_module_state['stdin'] = sys.stdin
809-
self._orig_sys_module_state['stdout'] = sys.stdout
810-
self._orig_sys_module_state['stderr'] = sys.stderr
811-
self._orig_sys_module_state['excepthook'] = sys.excepthook
807+
self._orig_sys_module_state = {'stdin': sys.stdin,
808+
'stdout': sys.stdout,
809+
'stderr': sys.stderr,
810+
'excepthook': sys.excepthook}
812811
self._orig_sys_modules_main_name = self.user_module.__name__
813812
self._orig_sys_modules_main_mod = sys.modules.get(self.user_module.__name__)
814813

IPython/testing/iptest.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,9 @@ def test_for(item, min_version=None, callback=extract_version):
115115

116116
# Global dict where we can store information on what we have and what we don't
117117
# have available at test run time
118-
have = {}
119-
120-
have['matplotlib'] = test_for('matplotlib')
121-
have['pygments'] = test_for('pygments')
122-
have['sqlite3'] = test_for('sqlite3')
118+
have = {'matplotlib': test_for('matplotlib'),
119+
'pygments': test_for('pygments'),
120+
'sqlite3': test_for('sqlite3')}
123121

124122
#-----------------------------------------------------------------------------
125123
# Test suite definitions

0 commit comments

Comments
 (0)