Don't memoize the empty tuple in protocol 0.

This commit is contained in:
Guido van Rossum 2003-01-28 14:40:16 +00:00
parent 4faea015f7
commit cbe2dbddda
1 changed files with 2 additions and 1 deletions

View File

@ -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