Python - 有没有办法在项目中默认使用所有字符串unicode?

Ive*_*ion 7 python unicode internationalization

而不是在每个刺痛前键入你?

...还有一些文本可以保持stackoverflow的快乐

tim*_*geb 13

是的,使用 from __future__ import unicode_literals

>>> from __future__ import unicode_literals
>>> s = 'hi'
>>> type(s)
<type 'unicode'>
Run Code Online (Sandbox Code Playgroud)

在Python 3中,默认情况下字符串是unicode字符串.