[issue16231] pickle persistent_id return value

2012-10-14 Thread PSchaafsma

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 
<http://bugs.python.org/issue16231>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16231] pickle persistent_id return value

2012-10-15 Thread PSchaafsma

PSchaafsma added the comment:

There are indeed many easy workarounds, and we definitely don't want to 
introduce any incompatibilities. 

I guess the best thing to do is just update the documentation, right?

--

___
Python tracker 
<http://bugs.python.org/issue16231>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com