如何将.decode(“unicode转义”)添加到所有ipython输出?

如何将.decode(“unicode转义”)添加到所有ipython输出?,ipython,python-unicode,Ipython,Python Unicode,在python和ipython中: In [1]: complex_object = ['test', u'тест'] In [2]: print(complex_object) ['test', u'\u0442\u0435\u0441\u0442'] In [3]: complex_object Out[3]: ['test', u'\u0442\u0435\u0441\u0442'] In [4]: print(complex_object[1]) тест In [5]: co

在python和ipython中:

In [1]: complex_object = ['test', u'тест']

In [2]: print(complex_object)
['test', u'\u0442\u0435\u0441\u0442']

In [3]: complex_object
Out[3]: ['test', u'\u0442\u0435\u0441\u0442']

In [4]: print(complex_object[1])
тест

In [5]: complex_object[1]
Out[5]: u'\u0442\u0435\u0441\u0442'

In [6]: print(complex_object.__repr__().decode("unicode-escape"))
['test', u'тест']
我如何配置ipython以始终输出如下变量:

In [1]: complex_object = ['test', u'тест']

In [2]: complex_object
['test', u'тест']
我所发现的是:

$ grep -n print_method core/formatters.py
216:       :attr:`print_method`. If is does, that object is passed to that method
236:    print_method = ObjectName('__repr__')
...
没有更多的文档