[Python-Dev] [Python-3000] inst_persistent_id

Alexandre Vassalotti alexandre at peadrop.com
Tue Jan 15 00:04:06 CET 2008


Oh, you are right. I thought that save_inst() used inst_persistent_id,
but that isn't the case. Now, I have checked more thoroughly and found
the relevant piece of code:

	if (!pers_save && self->inst_pers_func) {
		if ((tmp = save_pers(self, args, self->inst_pers_func)) != 0) {
			res = tmp;
			goto finally;
		}
	}

which is indeed called only when the object is not "supported" by pickle.

I guess my original argument doesn't hold anymore, thus I don't have
anything against supporting this feature officially.

Thanks for correcting me!
-- Alexandre


On Jan 14, 2008 12:59 PM, Armin Rigo <arigo at tunes.org> wrote:
> Hi,
>
> On Sat, Jan 12, 2008 at 07:33:38PM -0500, Alexandre Vassalotti wrote:
> > Well, in Python 3K, inst_persistent_id() won't be usable, since
> > PyInstance_Type was removed.
>
> Looking at the code, inst_persistent_id() is just a confusing name.  It
> has got nothing to do with PyInstance_Type; it's called for any object
> type that cPickle.c doesn't know how to handle.  In fact, it seems that
> cPickle.c never calls inst_persistent_id() for objects of type
> PyInstance_Type...
>
>
> A bientot,
>
> Armin.
>


More information about the Python-Dev mailing list