@@ -7,12 +7,8 @@ Who is this for?
771. People with existing or new Python 3 codebases who wish to provide
88ongoing Python 2.6 / 2.7 support easily and with little maintenance burden.
99
10- 2. People who wish to simplify migration of their codebases to Python
11- 3.3+, module by module, without giving up Python 2 compatibility.
12-
13- .. 3. People who would prefer to write clean, future-proof Python
14- .. 3-compatible code, but who are required to write code that still runs
15- .. on a Python 2 stack.
10+ 2. People who wish to ease and accelerate migration of their Python 2 codebases
11+ to Python 3.3+, module by module, without giving up Python 2 compatibility.
1612
1713
1814Why upgrade to Python 3?
@@ -29,9 +25,9 @@ Python 2.7 is the end of the Python 2 line. (See `PEP 404
2925libraries are improving only in Python 3.x.
3026
3127Python 3.x is a better language and better set of standard libraries than
32- Python 2.x in almost every way . Python 3.x is cleaner, less warty, and easier to
28+ Python 2.x in many ways . Python 3.x is cleaner, less warty, and easier to
3329learn than Python 2. It has better memory efficiency, easier Unicode handling,
34- and powerful new features like function annotations and the `asyncio
30+ and powerful new features like the `asyncio
3531<https://pypi.python.org/pypi/asyncio> `_ module.
3632
3733.. Unicode handling is also much easier. For example, see `this page
@@ -43,8 +39,8 @@ and powerful new features like function annotations and the `asyncio
4339 Porting philosophy
4440==================
4541
46- Why use this approach ?
47- ----------------------
42+ Why write Python 3-style code ?
43+ ------------------------------
4844
4945Here are some quotes:
5046
@@ -72,8 +68,8 @@ Here are some quotes:
7268Can't I just roll my own Py2/3 compatibility layer?
7369---------------------------------------------------
7470
75- Yes, but using ``future `` will probably lead to cleaner code with fewer
76- bugs.
71+ Yes, but using ``python- future `` will probably be easier and lead to cleaner
72+ code with fewer bugs.
7773
7874Consider this quote:
7975
@@ -88,28 +84,32 @@ Consider this quote:
8884
8985``future `` also includes various Py2/3 compatibility tools in
9086:mod: `future.utils ` picked from large projects (including IPython,
91- Django, Jinja2, Pandas), which should hopefully reduce the burden on
92- every project to roll its own py3k compatibility wrapper module.
87+ Django, Jinja2, Pandas), which should reduce the burden on every project to
88+ roll its own py3k compatibility wrapper module.
89+
9390
91+ What inspired this project?
92+ ---------------------------
9493
95- How did the original need for this arise?
96- -----------------------------------------
94+ In our Python training courses, we at `Python Charmers
95+ <http://pythoncharmers.com> `_ faced a dilemma: teach people Python 3, which was
96+ future-proof but not as useful to them today because of weaker 3rd-party
97+ package support, or teach people Python 2, which was more useful today but
98+ would require them to change their code and unlearn various habits soon. We
99+ searched for ways to avoid polluting the world with more deprecated code, but
100+ didn't find a good way.
97101
98- In teaching Python, we at Python Charmers faced a dilemma: teach people
99- Python 3, which was future-proof but not as useful to them today because
100- of weaker 3rd-party package support, or teach people Python 2, which was
101- more useful today but would require them to change their code and unlearn
102- various habits soon. We searched for ways to avoid polluting the world
103- with more deprecated code, but didn't find a good way.
102+ Also, in attempting to help with porting packages such as `scikit-learn
103+ <http://scikit-learn.org> `_ to Python 3, I (Ed) was dissatisfied with how much
104+ code cruft was necessary to introduce to support Python 2 and 3 from a single
105+ codebase (the preferred porting option). Since backward-compatibility with
106+ Python 2 may be necessary for at least the next 5 years, one of the promised
107+ benefits of Python 3 -- cleaner code with fewer of Python 2's warts -- was
108+ difficult to realize before in practice in a single codebase that supported
109+ both platforms.
104110
105- Also, in attempting to help with porting packages such as
106- ``scikit-learn `` to Python 3, I was dissatisfied with how much code cruft
107- was necessary to introduce to support Python 2 and 3 from a single
108- codebase (the preferred porting option). Since backward-compatibility
109- with Python 2 may be necessary for at least the next 5 years, one of the
110- promised benefits of Python 3 -- cleaner code with fewer of Python 2's
111- warts -- was difficult to realize before in practice in a single codebase
112- that supported both platforms.
111+ The goal is to accelerate the uptake of Python 3 and help the strong Python
112+ community to remain united around a single version of the language.
113113
114114
115115Maturity
@@ -123,8 +123,8 @@ Is it tested?
123123currently being used to help with porting 800,000 lines of Python 2 code in
124124`Sage <http://sagemath.org >`_ to Python 2/3.
125125
126- Currently ``future `` has 800+ unit tests. Many of these are straight from the
127- Python 3.3 test suite.
126+ Currently ``python- future `` has 800+ unit tests. Many of these are straight
127+ from the Python 3.3 test suite.
128128
129129In general, the ``future `` package itself is in good shape, whereas the
130130``futurize `` script for automatic porting is incomplete and imperfect.
@@ -151,11 +151,11 @@ version 2.0.
151151 modules under ``future/standard_library/``.
152152
153153
154- Relationship between `` future `` and other compatibility tools
155- =============================================================
154+ Relationship between python- future and other compatibility tools
155+ ================================================================
156156
157- How does this relate to ``2to3 `` and `` lib2to3 `` ?
158- -------------------------------------------------
157+ How does this relate to ``2to3 ``?
158+ ---------------------------------
159159
160160``2to3 `` is a powerful and flexible tool that can produce different
161161styles of Python 3 code. It is, however, primarily designed for one-way
@@ -206,31 +206,33 @@ auto-generated Python 3 code. (See `this talk
206206What is the relationship between ``future `` and ``six ``?
207207--------------------------------------------------------
208208
209- ``future `` is a higher-level compatibility layer than ``six `` that
209+ ``python- future `` is a higher-level compatibility layer than ``six `` that
210210includes more backported functionality from Python 3 and supports cleaner
211211code but requires more modern Python versions to run.
212212
213- ``future `` and ``six `` share the same goal of making it possible to write
213+ ``python- future `` and ``six `` share the same goal of making it possible to write
214214a single-source codebase that works on both Python 2 and Python 3.
215- ``future `` has the further goal of allowing standard Py3 code to run with
215+ ``python- future `` has the further goal of allowing standard Py3 code to run with
216216almost no modification on both Py3 and Py2. ``future `` provides a more
217217complete set of support for Python 3's features, including backports of
218218Python 3 builtins such as the ``bytes `` object (which is very different
219219to Python 2's ``str `` object) and several standard library modules.
220220
221- ``future `` supports only Python 2.6+ and Python 3.3+, whereas ``six ``
221+ ``python- future `` supports only Python 2.6+ and Python 3.3+, whereas ``six ``
222222supports all versions of Python from 2.4 onwards. (See
223223:ref: `supported-versions `.) If you must support older Python versions,
224224``six `` will be esssential for you. However, beware that maintaining
225225single-source compatibility with older Python versions is ugly and `not
226226fun <http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/> `_.
227227
228- If you can drop support for older Python versions, ``future `` leverages
228+ If you can drop support for older Python versions, ``python- future `` leverages
229229some important features introduced into Python 2.6 and 2.7, such as
230- import hooks, to allow you to write more idiomatic, maintainable code.
230+ import hooks, and a comprehensive and well-tested set of backported
231+ functionality, to allow you to write more idiomatic, maintainable code with
232+ fewer compatibility hacks.
231233
232234
233- What is the relationship between this project and ``python-modernize ``?
235+ What is the relationship between `` python-future `` and ``python-modernize ``?
234236-----------------------------------------------------------------------
235237
236238``python-future `` contains, in addition to the ``future `` compatibility
@@ -240,7 +242,7 @@ in intent and design. Both are based heavily on ``2to3``.
240242Whereas ``python-modernize `` converts Py2 code into a common subset of
241243Python 2 and 3, with ``six `` as a run-time dependency, ``futurize ``
242244converts either Py2 or Py3 code into (almost) standard Python 3 code,
243- with ``future `` as a run-time dependency.
245+ with ``future `` as a run-time dependency.
244246
245247Because ``future `` provides more backported Py3 behaviours from ``six ``,
246248the code resulting from ``futurize `` is more likely to work
@@ -253,7 +255,7 @@ Platform and version support
253255
254256.. _supported-versions :
255257
256- Which versions of Python does ``future `` support?
258+ Which versions of Python does ``python- future `` support?
257259-------------------------------------------------
258260
259261Python 2.6, 2.7, and 3.3+ only.
0 commit comments