擅长:python、mysql、java
<p>我认为最接近的是<a href="http://docs.python.org/library/pprint.html" rel="noreferrer">pprint</a>模块。</p>
<pre><code>>>> l = [1, 2, 3, 4]
>>> l.append(l)
>>> d = {1: l, 2: 'this is a string'}
>>> print d
{1: [1, 2, 3, 4, [...]], 2: 'this is a string'}
>>> pprint.pprint(d)
{1: [1, 2, 3, 4, <Recursion on list with id=47898714920216>],
2: 'this is a string'}
</code></pre>