stefan_ml at behnel.de
Thu Feb 14 19:31:25 CET 2008
castironpi at gmail.com wrote:
> On Feb 14, 12:45 am, Stefan Behnel <stefan... at behnel.de> wrote:
>> castiro... at gmail.com wrote:
>>> Readability of the Pickle module. Can one export to XML, from cost of
>>> speed and size, to benefit of user-readability?
>> Regarding pickling to XML, lxml.objectify can do that:
>>> It does something else: plus functions do not export their code,
>>> either in interpreter instructions, or source, or anything else; and
>>> classes do not export their dictionaries, just their names. But it
>>> does export in ASCII.
>>> Pickle checks any __safe_for_unpickling__ and __setstate__ methods,
>>> which enable a little encapsulating, but don't go far.
>> I'm having a hard time to understand what you are trying to achieve. Could you
>> state that in a few words? That's usually better than asking for a way to do X
>> with Y. Y (i.e. pickling in this case) might not be the right solution for you.
> The example isn't so bad. It's not clear that it isn't already too
> specific. Pickling isn't what I want. XML is persistent too.
> XML could go a couple ways. You could export source, byte code, and
> type objects. (Pickle could do that too, thence the confusion
What I meant was: please state what you are trying to do. What you describe
are the environmental conditions and possible solutions that you are thinking
of, but it doesn't tell me what problem you are actually trying to solve.
> gnosis.xml and lxml have slightly different outputs. What I'm going
> for has been approached a few different times a few different ways
> already. If all I want is an Excel-readable file, that's one end of
> the spectrum. If you want something more general, but still include
> Excel, that's one of many decisions to make. Ideas.
> How does lxml export: b= B(); a.b= b; dumps( a )?
> It looks like he can create the XML from the objects already.
In lxml.objectify, the objects *are* the XML tree. It's all about objects
being bound to specific elements in the tree.
More information about the Python-list