On Mon, 9 Oct 2023 at 23:12, Nathan <nathan.goldb...@gmail.com> wrote:
> On Mon, Oct 9, 2023 at 3:58 PM Oscar Benjamin <oscar.j.benja...@gmail.com> 
> wrote:
>>
>> On Mon, 9 Oct 2023 at 22:30, Nathan <nathan.goldb...@gmail.com> wrote:
>> >
>> > On Mon, Oct 9, 2023 at 3:12 PM Oscar Benjamin <oscar.j.benja...@gmail.com> 
>> > wrote:
>> >>
>> >> I guess that makes it possible in some way to convert formats in
>> >> either version. I presume though that this still means that a plain
>> >> pickle.loads() (and any code built on top of such) would fail in v2.
>> >
>> > In Numpy2.0 you would see a deprecation warning about the path in the 
>> > pickle file but no crash. Eventually, when we finally remove the stub 
>> > np.core, you would see a crash.
>>
>> Okay, that makes sense. What happens in the reverse scenario: loading
>> a pickle generated by NumPy 2.0 using NumPy 1.x?
>
> There would be a crash, so people creating these pickles would need to tell 
> users to load them using NumpyUnpickler. Do you see that being problematic? 
> It would only impact newly created pickle files and there would be an 
> immediate fix available - use NumpyUnpickler.load instead of pickle.load.

I am sure that it will be problematic for someone but maybe that is
just part of the collateral damage that should be expected with
changes like this. (I don't have any particular opinion about what is
right here.)

Using NumPyUnpickler is not a simple fix for anyone who is using
pickle indirectly e.g. via another function that calls pickle.load
internally.

--
Oscar
_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to