[Python-Dev] Python 2/3 porting HOWTO has been updated
Nick Coghlan
ncoghlan at gmail.com
Sat Dec 6 05:40:44 CET 2014
On 6 December 2014 at 10:44, Benjamin Peterson <benjamin at python.org> wrote:
> On Fri, Dec 5, 2014, at 18:16, Donald Stufft wrote:
>> Do we need to update it? Can it just redirect to the 3 version?
>
> Technically, yes, of course. However, that would unexpected take you out
> of the Python 2 docs "context". Also, that doesn't solve the problem for
> the downloadable versions of the docs.
As Benjamin says, we'll likely want to update the Python 2 version
eventually for the benefit of the downloadable version of the docs,
but Brett's also right it makes sense to wait for feedback on the
Python 3 version and then backport the most up to date text wholesale.
In terms of the text itself, this is a great update Brett - thanks!
A couple of specific notes:
* http://python-future.org/compatible_idioms.html is my favourite
short list of "What are the specific Python 2 only habits that I need
to unlearn in order to start writing 2/3 compatible code?". It could
be worth mentioning in addition to the What's New documents and the
full Python 3 Porting book.
* it's potentially worth explicitly noting the "bytes(index_value)"
and "str(bytes_value)" traps when discussing the bytes/text changes.
Those do rather different things in Python 2 & 3, but won't emit an
error or warning in either version.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev
mailing list