Currently, pickle can only save some very simple data types into bytes.

And the object itself contains reference to some builtin data or variable, only 
reference will be saved.

I am wondering if it is possible recursively persist all the data into pickle 
representation. Even if some data might be builtin function of variable, it 
will represent it in very raw (memory level).

If it contains function it will persist all its attribute, and code object.

Method-wrapper and all its attribute will be persist entirely.

If it contains two attribute with same memory location `id(x)` is same, then 
they can be persist as one, and reference each other.

For example, if user pickle recursively dump a numpy ndarray into a pickle 
file, when user pickle load this file from a system which doesn't install 
numpy, its method should all works properly like transpose, reshape ...

When applying recursively dump, the output pickle file or bytes might be very 
large.

All related memory data will be dumped.

As the example of numpy ndarray, when doing recursively dump, large part of 
numpy library's content will be persist except those really lose or none 
coupled part.

This is actually a cool feature, because pickle is to keep python object, 
completeness is a great advantage of pickle than json and other data persist 
library.

Sent with ProtonMail Secure Email.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/JGYMOCZVONB25FXXUQ67H6PRV6WCTQYE/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to