[Python-ideas] Serializable method

anatoly techtonik techtonik at gmail.com
Fri Mar 9 23:36:53 CET 2012


Pickle is insecure, unfortunately, so a generic module to serialize
and unserialize Python objects (or data containers) securely, without
the need of constructor, would be awesome. However, magical methods
are evil. It will be hard to find the source of error if the logic in
your magic level fail.
--
anatoly t.



On Fri, Mar 9, 2012 at 8:27 PM, Jakob Bowyer <jkbbwr at gmail.com> wrote:
> Another occasion I should have read the docs :L
>
>
> On Fri, Mar 9, 2012 at 5:22 PM, Oleg Broytman <phd at phdru.name> wrote:
>>
>> On Fri, Mar 09, 2012 at 05:05:51PM +0000, Jakob Bowyer wrote:
>> > I think that object should provide an __serializable__ method which
>> > in-turn
>> > allows the user to define in it how the object is to be serialized, the
>> > default operation should be something along the lines of  return
>> > self.__dict__
>>
>>   Do you mean __getstate__?
>> http://docs.python.org/library/pickle.html#the-pickle-protocol
>>
>> Oleg.
>> --
>>     Oleg Broytman            http://phdru.name/            phd at phdru.name
>>           Programmers don't die, they just GOSUB without RETURN.
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> http://mail.python.org/mailman/listinfo/python-ideas
>
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>



More information about the Python-ideas mailing list