[issue16231] pickle persistent_id return value

PSchaafsma report at bugs.python.org
Sun Oct 14 16:30:17 CEST 2012


New submission from PSchaafsma:

The documentation of persistent_id prescribes that returning None will cause default pickling behavior. This makes sense.

However, in the Pickler.save function in pickle.py, the return value of persistent_id checked as boolean, causing also return values like 0 and [] to indicate default pickling.

This becomes a problem when unpickleable objects are identified by a simple index in some other list.

----------
components: Library (Lib)
messages: 172887
nosy: pschaafsma
priority: normal
severity: normal
status: open
title: pickle persistent_id return value
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16231>
_______________________________________


More information about the Python-bugs-list mailing list