This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients alexandre.vassalotti, amaury.forgeotdarc, barry, benjamin.peterson, nnorwitz, pitrou, tim.peters
Date 2008-09-13.04:14:46
SpamBayes Score 5.759948e-12
Marked as misclassified No
Message-id <1221279287.54.0.322756532803.issue3657@psf.upfronthosting.co.za>
In-reply-to
Content
BTW, note that the Title of this issue is misleading: 
pickle.whichmodule() uses object identity ("is":

    if ...  getattr(module, funcname, None) is func:

) to determine whether the given function object is supplied by a
module, so it's /not/ the case that a "wrong" function can be pickled. 
The worst that can happen is that the correct function is pickled but
obtained from a possibly surprising module.  For example, random.random
can't be confused with any other function named "random".

I expect this is why nobody has ever complained about it:  unless you're
looking at the strings embedded in the pickle GLOBAL opcode, it's
unlikely to have a visible consequence.

It would still be nice if pickle could identify "the most natural"
module for a given function, but hard to make a case that doing so would
be much more than /just/ "nice".
History
Date User Action Args
2008-09-13 04:14:47tim.peterssetrecipients: + tim.peters, barry, nnorwitz, amaury.forgeotdarc, pitrou, alexandre.vassalotti, benjamin.peterson
2008-09-13 04:14:47tim.peterssetmessageid: <1221279287.54.0.322756532803.issue3657@psf.upfronthosting.co.za>
2008-09-13 04:14:46tim.peterslinkissue3657 messages
2008-09-13 04:14:46tim.peterscreate