コード例 #1
0
 def add_const(self, value):
     key = const_key(value)
     if key in self.consts:
         return self.consts[key]
     index = len(self.consts)
     self.consts[key] = index
     return index
コード例 #2
0
ファイル: concrete.py プロジェクト: st-rnd/bytecode
 def add_const(self, value):
     key = const_key(value)
     if key in self.consts_indices:
         return self.consts_indices[key]
     index = len(self.consts_indices)
     self.consts_indices[key] = index
     self.consts_list.append(value)
     return index