Is there a way to make all unicode lines in a project by default?

Instead of typing u before each bite?

... and another text to keep stackoverflow happy

+5
source share
1 answer

Yes, use from __future__ import unicode_literals

 >>> from __future__ import unicode_literals >>> s = 'hi' >>> type(s) <type 'unicode'> 

In Python 3, strings are unicode strings by default.

+7
source

Source: https://habr.com/ru/post/1243401/


All Articles