Home | History | Annotate | Download | only in python2.7

Lines Matching refs:memo

128 GET             = 'g'   # push item from memo on stack; index is string arg
131 LONG_BINGET = 'j' # push item from memo on stack; index is 4-byte arg
135 PUT = 'p' # store stack top in memo; index is string arg
204 self.memo = {}
210 """Clears the pickler's "memo".
212 The memo is the data structure that remembers which objects the
218 self.memo.clear()
228 """Store an object in the memo."""
230 # The Pickler memo is a dictionary mapping object ids to 2-tuples
231 # that contain the Unpickler memo key and the object being memoized.
232 # The memo key is written to the pickle and will become
233 # the key in the Unpickler's memo. The object is stored in the
234 # Pickler memo so that transient objects are kept alive during
237 # The use of the Unpickler memo length as the memo key is just a
238 # convention. The only requirement is that the memo values be unique.
240 # scheme allows the Unpickler memo to be implemented as a plain (but
241 # growable) array, indexed by memo key.
244 assert id(obj) not in self.memo
245 memo_len = len(self.memo)
247 self.memo[id(obj)] = memo_len, obj
276 # Check the memo
277 x = self.memo.get(id(obj))
545 memo = self.memo
550 if id(obj) in memo:
551 get = self.get(memo[id(obj)][0])
564 if id(obj) in memo:
565 # Subtle. d was not in memo when we entered save_tuple(), so
572 get = self.get(memo[id(obj)][0])
693 memo = self.memo
700 _keep_alive(args, memo)
724 _keep_alive(stuff, memo)
732 memo = self.memo
777 def _keep_alive(x, memo):
778 """Keeps a reference to the object x in the memo.
783 We store a reference at the id of the memo, which should
785 the memo itself...
788 memo[id(memo)].append(x)
791 memo[id(memo)]=[x]
843 self.memo = {}
1151 self.append(self.memo[self.readline()[:-1]])
1156 self.append(self.memo[repr(i)])
1161 self.append(self.memo[repr(i)])
1165 self.memo[self.readline()[:-1]] = self.stack[-1]
1170 self.memo[repr(i)] = self.stack[-1]
1175 self.memo[repr(i)] = self.stack[-1]