Changes between Initial Version and Version 1 of Ticket #16563, comment 20


Ignore:
Timestamp:
Dec 10, 2011, 9:45:26 AM (13 years ago)
Author:
Luke Plant

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16563, comment 20

    initial v1  
    55There is one potential backwards compatibility concern here: if you had used a `SimpleLazyObject` with a callable that was itself pickleable, it would previously have been possible to pickle that `SimpleLazyObject` without the patch. Potentially, the object could have been pickled in the 'lazy' state, without the callable having been called.
    66
    7 However, I've tested this, and it seems that - for whatever reason - calling `pickle.dumps` causes the the callable to be called. Therefore, the object is not serialised in a 'lazy' state - it is always 'evaluated'. And this is just the same as it currently is, except we have made it explicit. The only difference now is that `SimpleLazyObject._setupfunc` is ''never'' available now after unpickling, but that shouldn't be a problem since it is never used.
     7However, I've tested this, and it seems that - for whatever reason - calling `pickle.dumps` causes the the callable to be called. Therefore, the object is not serialised in a 'lazy' state - it is always 'evaluated'. And this is just the same as it is with the patch, except I have made it explicit. The only difference now is that `SimpleLazyObject._setupfunc` is ''never'' available now after unpickling, but that shouldn't be a problem since it is never used.
    88
    99I'm therefore fairly confident that this patch shouldn't cause other problems.
Back to Top