[Python-checkins] cpython: Issue #26647: Cleanup opcode

victor.stinner python-checkins at python.org
Tue Apr 12 12:44:47 EDT 2016


https://hg.python.org/cpython/rev/7bf08a11d4c9
changeset:   100940:7bf08a11d4c9
parent:      100938:a5acd7ca8727
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Apr 12 18:15:26 2016 +0200
summary:
  Issue #26647: Cleanup opcode

Simplify code to build opcode.opname. Patch written by Demur Rumed.

files:
  Lib/opcode.py |  4 +---
  1 files changed, 1 insertions(+), 3 deletions(-)


diff --git a/Lib/opcode.py b/Lib/opcode.py
--- a/Lib/opcode.py
+++ b/Lib/opcode.py
@@ -34,9 +34,7 @@
 hasnargs = []
 
 opmap = {}
-opname = [''] * 256
-for op in range(256): opname[op] = '<%r>' % (op,)
-del op
+opname = ['<%r>' % (op,) for op in range(256)]
 
 def def_op(name, op):
     opname[op] = name

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list