Skip to content

Commit 660cc77

Browse files
committed
Inside a class scope always use LOAD_NAME, STORE_NAME, DEL_NAME
1 parent 364f9b9 commit 660cc77

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Lib/compiler/pycodegen.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,9 @@ def __init__(self, klass, filename, scopes):
11521152
if klass.doc:
11531153
self.setDocstring(klass.doc)
11541154

1155+
def _nameOp(self, prefix, name):
1156+
self.emit(prefix + '_NAME', name)
1157+
11551158
def finish(self):
11561159
self.graph.startExitBlock()
11571160
self.emit('LOAD_LOCALS')

Tools/compiler/compiler/pycodegen.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,9 @@ def __init__(self, klass, filename, scopes):
11521152
if klass.doc:
11531153
self.setDocstring(klass.doc)
11541154

1155+
def _nameOp(self, prefix, name):
1156+
self.emit(prefix + '_NAME', name)
1157+
11551158
def finish(self):
11561159
self.graph.startExitBlock()
11571160
self.emit('LOAD_LOCALS')

0 commit comments

Comments
 (0)