pythonmoduleobject-dumper

Is there a Python equivalent to Perl's Data::Dumper for inspecting data structures?


Is there a Python module that can be used in the same way as Perl's Data::Dumper module?

Edit: Sorry, I should have been clearer. I was mainly after a module for inspecting data rather than persisting.

BTW Thanks for the answers. This is one awesome site!


Solution

  • Data::Dumper has two main uses: data persistence and debugging/inspecting objects. As far as I know, there isn't anything that's going to work exactly the same as Data::Dumper.

    I use pickle for data persistence.

    I use pprint to visually inspect my objects / debug.