diff -r e53984133740 Doc/howto/pyporting.rst --- a/Doc/howto/pyporting.rst Thu Nov 14 00:24:31 2013 +1000 +++ b/Doc/howto/pyporting.rst Fri Jan 10 14:51:48 2014 +0100 @@ -210,23 +210,29 @@ ``from __future__ import print_function`` ''''''''''''''''''''''''''''''''''''''''' -This is a personal choice. 2to3 handles the translation from the print -statement to the print function rather well so this is an optional step. This -future statement does help, though, with getting used to typing -``print('Hello, World')`` instead of ``print 'Hello, World'``. +This is a personal choice. It makes the ``print`` statement invalid, +and Python 3's ```print()`` function available. 2to3 handles the +translation from the print statement to the print function rather +well so this is an optional step. This future statement does help, +though, with getting used to typing ``print('Hello, World')`` instead +of ``print 'Hello, World'``. It also gives you the various benefits +that the function has over the statement. ``from __future__ import unicode_literals`` ''''''''''''''''''''''''''''''''''''''''''' -Another personal choice. You can always mark what you want to be a (unicode) -string with a ``u`` prefix to get the same effect. But regardless of whether -you use this future statement or not, you **must** make sure you know exactly -which Python 2 strings you want to be bytes, and which are to be strings. This -means you should, **at minimum** mark all strings that are meant to be text -strings with a ``u`` prefix if you do not use this future statement. Python 3.3 -allows strings to continue to have the ``u`` prefix (it's a no-op in that case) -to make it easier for code to be source-compatible between Python 2 & 3. +Another personal choice. This forces Python 2 to mark all un-prefixed +strings as unicode. You can always mark what you want to be a +(unicode) string with a ``u`` prefix to get the same effect. But +regardless of whether you use this future statement or not, you +**must** make sure you know exactly which Python 2 strings you want to +be bytes, and which are to be strings. This means you should, **at +minimum** mark all strings that are meant to be text strings with a +``u`` prefix if you do not use this future statement. Python 3.3 +allows strings to continue to have the ``u`` prefix (it's a no-op in +that case) to make it easier for code to be source-compatible between +Python 2 & 3. Bytes literals @@ -538,8 +544,9 @@ Update `map` for imbalanced input sequences ''''''''''''''''''''''''''''''''''''''''''' -With Python 2, `map` would pad input sequences of unequal length with -`None` values, returning a sequence as long as the longest input sequence. +With Python 2, `map` would, when given more than once input sequence, +pad sequences of unequal length with `None` values, returning a +sequence as long as the longest input sequence. With Python 3, if the input sequences to `map` are of unequal length, `map` will stop at the termination of the shortest of the sequences. For full