[issue16231] pickle persistent_id return value
Changes by Alexandre Vassalotti alexan...@peadrop.com: -- assignee: - alexandre.vassalotti resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16231 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16231] pickle persistent_id return value
Roundup Robot added the comment: New changeset ee627983ba28 by Alexandre Vassalotti in branch '2.7': Issue #16231: Allow false values other than None to be used as persistent IDs. http://hg.python.org/cpython/rev/ee627983ba28 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16231 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16231] pickle persistent_id return value
Alexandre Vassalotti added the comment: I think it should be fixed though it is not a high-priority issue. -- ___ Python tracker rep...@bugs.python.org 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
Serhiy Storchaka added the comment: It was fixed for Python 3 in 0ae50aa7d97c. Should it be fixed in 2.7 too or close the issue as won't fix? Note that cPickle tests the return value of persistent_id only for None. -- nosy: +alexandre.vassalotti, pitrou, serhiy.storchaka ___ Python tracker rep...@bugs.python.org 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
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org 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
Amaury Forgeot d'Arc added the comment: An easy workaround (and probably the preferred method) it to return a (tag, index) tuple, like the example in http://docs.python.org/release/3.2/library/pickle.html#pickle-persistent Testing for the None value introduces a slight incompatibility, so IMO it could only be changed for 3.4. -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org 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
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 rep...@bugs.python.org 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
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 rep...@bugs.python.org http://bugs.python.org/issue16231 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com