From: Victor Stinner Date: Tue, 12 Apr 2016 16:15:26 +0000 (+0200) Subject: Issue #26647: Cleanup opcode X-Git-Tag: v3.6.0a1~227 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b228231c78f49986928cd587cbf85197a3b3987;p=python Issue #26647: Cleanup opcode Simplify code to build opcode.opname. Patch written by Demur Rumed. --- diff --git a/Lib/opcode.py b/Lib/opcode.py index 71ce67233b..ecc24bb165 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -34,9 +34,7 @@ hasfree = [] 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