From cbe2dbddda7bbcf2f27ba668b86b21596c900edf Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 28 Jan 2003 14:40:16 +0000 Subject: Don't memoize the empty tuple in protocol 0. --- Lib/pickle.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/pickle.py b/Lib/pickle.py index 02288d8..2baee46 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -502,7 +502,8 @@ class Pickler: # No recursion (including the empty-tuple case for protocol 0). self.write(TUPLE) - self.memoize(object) # XXX shouldn't memoize empty tuple?! + if object: # No need to memoize empty tuple + self.memoize(object) dispatch[TupleType] = save_tuple -- cgit v0.12