Legend:

There 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.

6

6

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.

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 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.