@@ -7,28 +7,22 @@ Should I import unicode_literals?
77The ``future `` package can be used with or without ``unicode_literals ``
88imports.
99
10- There is some contention in the community about whether it is advisable
11- to import ``unicode_literals `` from ``__future__ `` in a Python 2/3
12- compatible codebase.
13-
14- In general, it is more compelling to use ``unicode_literals `` when back-porting
15- new or existing Python 3 code to Python 2/3 than when porting existing Python 2
16- code to 2/3. In the latter case, explicitly marking up all unicode string
17- literals with ``u'' `` prefixes would help to avoid unintentionally
18- changing the existing Python 2 API.
19-
20- If changing the existing Python 2 API is not a concern, using
21- ``unicode_literals `` may speed up the porting process. If you use
22- ``unicode_literals ``, testing and debugging your code with *Python 3 * first is
23- probably the easiest way to fix your code. After this, fixing Python 2 support
24- will be easier.
25-
26- To avoid confusion, we recommend using ``unicode_literals `` everywhere
27- across a code-base or not at all, instead of turning on for only some
28- modules.
10+ There is some disagreement in the community about whether it is advisable to
11+ import ``unicode_literals `` from ``__future__ `` in a Python 2/3 compatible
12+ codebase. In general, it is more compelling to use ``unicode_literals `` when
13+ back-porting new or existing Python 3 code to Python 2/3 than when porting
14+ existing Python 2 code to 2/3. In the latter case, explicitly marking up all
15+ unicode string literals with ``u'' `` prefixes would help to avoid
16+ unintentionally changing the existing Python 2 API. If changing the existing
17+ Python 2 API is not a concern, using ``unicode_literals `` may speed up the
18+ porting process.
2919
3020This section summarizes the benefits and drawbacks of using
31- ``unicode_literals ``.
21+ ``unicode_literals ``. To avoid confusion, we recommend using
22+ ``unicode_literals `` everywhere across a code-base or not at all, instead of
23+ turning on for only some modules.
24+
25+
3226
3327Benefits
3428~~~~~~~~
0 commit comments