# 2011-07-08  A perl Data.Dumper clone for Python

Perl中的Data::Dumper很好用，可以非常方便的将任意数据类型dump成可读的形式，debug的时候用来查看运行期的某种复杂数据结构非常的方便。

下面的这段代码是一个用于Python的近似实现，包含部分格式化的选项。几年前写的这段代码，其实还有不少改进的空间。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.log4think.com/data-dumper-for-python.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
