Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2645bad

Browse files
committed
Make the case to only support Python 2.7 when supporting 2/3 simultaneously
1 parent 577fc4e commit 2645bad

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

Doc/howto/pyporting.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@ The Short Explanation
2828
To make your project be single-source Python 2/3 compatible, the basic steps
2929
are:
3030

31-
#. Update your code to drop support for Python 2.5 or older (supporting only
32-
Python 2.7 is ideal)
31+
#. Only worry about supporting Python 2.7
3332
#. Make sure you have good test coverage (coverage.py_ can help;
3433
``pip install coverage``)
3534
#. Learn the differences between Python 2 & 3
3635
#. Use Modernize_ or Futurize_ to update your code (``pip install modernize`` or
3736
``pip install future``, respectively)
3837
#. Use Pylint_ to help make sure you don't regress on your Python 3 support
39-
(if only supporting Python 2.7/3.4 or newer; ``pip install pylint``)
38+
(``pip install pylint``)
4039
#. Use caniusepython3_ to find out which of your dependencies are blocking your
4140
use of Python 3 (``pip install caniusepython3``)
4241
#. Once your dependencies are no longer blocking you, use continuous integration
@@ -67,26 +66,27 @@ Keep those key points in mind while you read on about the details of porting
6766
your code to support Python 2 & 3 simultaneously.
6867

6968

70-
Drop support for Python 2.5 and older (at least)
71-
------------------------------------------------
69+
Drop support for Python 2.6 and older
70+
-------------------------------------
7271

7372
While you can make Python 2.5 work with Python 3, it is **much** easier if you
74-
only have to work with Python 2.6 or newer (and easier still if you only have
75-
to work with Python 2.7). If dropping Python 2.5 is not an option then the six_
76-
project can help you support Python 2.5 & 3 simultaneously
73+
only have to work with Python 2.7. If dropping Python 2.5 is not an
74+
option then the six_ project can help you support Python 2.5 & 3 simultaneously
7775
(``pip install six``). Do realize, though, that nearly all the projects listed
7876
in this HOWTO will not be available to you.
7977

80-
If you are able to only support Python 2.6 or newer, then the required changes
78+
If you are able to skip Python 2.5 and older, then the required changes
8179
to your code should continue to look and feel like idiomatic Python code. At
8280
worst you will have to use a function instead of a method in some instances or
8381
have to import a function instead of using a built-in one, but otherwise the
8482
overall transformation should not feel foreign to you.
8583

86-
But please aim for Python 2.7. Bugfixes for that version of Python will continue
87-
until 2020 while Python 2.6 is no longer supported. There are also some tools
88-
mentioned in this HOWTO which do not support Python 2.6 (e.g., Pylint_), and
89-
this will become more commonplace as time goes on.
84+
But you should aim for only supporting Python 2.7. Python 2.6 is no longer
85+
supported and thus is not receiving bugfixes. This means **you** will have to
86+
work around any issues you come across with Python 2.6. There are also some
87+
tools mentioned in this HOWTO which do not support Python 2.6 (e.g., Pylint_),
88+
and this will become more commonplace as time goes on. It will simply be easier
89+
for you if you only support the versions of Python that you have to support.
9090

9191
Make sure you specify the proper version support in your ``setup.py`` file
9292
--------------------------------------------------------------------------

0 commit comments

Comments
 (0)