Message73165
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". |
|
Date |
User |
Action |
Args |
2008-09-13 04:14:47 | tim.peters | set | recipients:
+ tim.peters, barry, nnorwitz, amaury.forgeotdarc, pitrou, alexandre.vassalotti, benjamin.peterson |
2008-09-13 04:14:47 | tim.peters | set | messageid: <1221279287.54.0.322756532803.issue3657@psf.upfronthosting.co.za> |
2008-09-13 04:14:46 | tim.peters | link | issue3657 messages |
2008-09-13 04:14:46 | tim.peters | create | |
|