Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
XML document causes pickle to go into infinite recursion
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Stefan Behnel, post: 3120534"] minidom creates a pretty complete tree data structure, with loads of backlinks to parent elements etc. That's where your circular references come from. I don't know why you want to use pickle here (and not serialised XML or the plain in-memory tree), but if memory consumption is an issue, try cElementTree, which comes with Python 2.5 (or as an external module for older versions). It's faster, more memory friendly and easier to use than minidom. There's also lxml.objectify, in case you can't live without pickeling. [URL]http://effbot.org/zone/celementtree.htm[/URL] [URL]http://codespeak.net/lxml[/URL] Stefan [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
XML document causes pickle to go into infinite recursion
Top