mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Don't memoize the empty tuple in protocol 0.
This commit is contained in:
parent
4faea015f7
commit
cbe2dbddda
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue