[pypy-svn] r63481 - pypy/trunk/pypy/objspace/flow

arigo at codespeak.net arigo at codespeak.net
Wed Apr 1 13:24:30 CEST 2009


Author: arigo
Date: Wed Apr  1 13:24:28 2009
New Revision: 63481

Modified:
   pypy/trunk/pypy/objspace/flow/objspace.py
Log:
Replace this loop with a normal dict syntax.


Modified: pypy/trunk/pypy/objspace/flow/objspace.py
==============================================================================
--- pypy/trunk/pypy/objspace/flow/objspace.py	(original)
+++ pypy/trunk/pypy/objspace/flow/objspace.py	Wed Apr  1 13:24:28 2009
@@ -469,19 +469,15 @@
 
 # ______________________________________________________________________
 
-op_appendices = {}
-for _name, _exc in(
-    ('ovf', OverflowError),
-    ('idx', IndexError),
-    ('key', KeyError),
-    ('att', AttributeError),
-    ('typ', TypeError),
-    ('zer', ZeroDivisionError),
-    ('val', ValueError),
-    #('flo', FloatingPointError)
-    ):
-    op_appendices[_exc] = _name
-del _name, _exc
+op_appendices = {
+    OverflowError: 'ovf',
+    IndexError: 'idx',
+    KeyError: 'key',
+    AttributeError: 'att',
+    TypeError: 'typ',
+    ZeroDivisionError: 'zer',
+    ValueError: 'val',
+    }
 
 implicit_exceptions = {
     int: [ValueError],      # built-ins that can always raise exceptions



More information about the Pypy-commit mailing list