Skip to content
Myr

python3.rst

This file

Path

docs/python3.rst

47 lines · 1.9 KiB

Last changed by

Describe the nature of Python 3 roughnessSven-Hendrik Haasebefore adoptioneb6df3d

History of this file

Take it

The walk stopped after 200 commits: lines older than c9337c0 point at it.

Merge branch '0.10-maintenance'Armin Ronacherbefore adoptionc9337c0

lines 1–21why, one step back
1.. _python3-support:
23Python 3 Support4================56Flask and all of its dependencies support Python 3 so you can in theory7start working on it already. There are however a few things you should be8aware of before you start using Python 3 for your next project.910Requirements11------------1213If you want to use Flask with Python 3 you will need to use Python 3.3 or14higher. 3.2 and older are *not* supported.1516In addition to that you need to use the latest and greatest versions of17`itsdangerous`, `Jinja2` and `Werkzeug`.1819API Stability20-------------21

Merge pull request #1055 from IanConnolly/doc-fixKenneth Reitzbefore adoption332fa79

line 22why, one step back
22Some of the decisions made in regards to unicode and byte utilization on

Merge branch '0.10-maintenance'Armin Ronacherbefore adoptionc9337c0

lines 23–35why, one step back
23Python 3 make it hard to write low level code. This mainly affects WSGI
24middlewares and interacting with the WSGI provided information. Werkzeug25wraps all that information in high-level helpers but some of those were26specifically added for the Python 3 support and are quite new.2728A lot of the documentation out there on using WSGI leaves out those29details as it was written before WSGI was updated to Python 3. While the30API for Werkzeug and Flask on Python 2.x should not change much we cannot31guarantee that this won't happen on Python 3.3233Recommendations34---------------35

Update information about Python 3Sven-Hendrik Haasebefore adoption83336e0

lines 36–37why, one step back
36Unless you require absolute compatibility, you should be fine with Python 3
37nowadays. Most libraries and Flask extensions have been ported by now and

Describe the nature of Python 3 roughnessSven-Hendrik Haasebefore adoptioneb6df3d

lines 38–41why, one step back
38using Flask with Python 3 is generally a smooth ride. However, keep in mind
39that most libraries (including Werkzeug and Flask) might not quite as stable40on Python 3 yet. You might therefore sometimes run into bugs that are41usually encoding-related.

Merge branch '0.10-maintenance'Armin Ronacherbefore adoptionc9337c0

lines 42–47why, one step back
42
43The majority of the upgrade pain is in the lower-level libararies like44Flask and Werkzeug and not in the actual high-level application code. For45instance all of the Flask examples that are in the Flask repository work46out of the box on both 2.x and 3.x and did not require a single line of47code changed.