
Armin Rahner posted on his blog the
news about updating popular web frameworks for python: Flask and its underlying Werkzeug. The most important change was the support of python version 3 (starting with 3.3 and above). Also, the low-level Werkzeug API was slightly modified to, on the one hand, implement support for the specification from the
PEP 3333 , and on the other, not to lose in performance. With the new version, support for Python version 2.5 is lost.
If you are using Werkzeug, then you may have to tinker with the updated version. As for Flask, everything is somewhat simpler here, because The API hasn't changed much.
')
It is important to note that in a certain sense Flask and Werkzeug were somewhat delayed by the update, because the most popular components that make up the standard stack of the application: the Jinja2 and ORM SQLAlchemy template engine has been supporting the third version python for quite a long time. By the way, at one time, Armin
criticized in his blog too radical language changes, and spoke rather coldly about the third version.
Other changes
Werkzeug
- The ability to send a traceback error from Werkzeug to a private github gist.
- Minor changes to the HTTP classes of the Werkzeug.
- Improved IRI support, slightly violating the relevant RFCs. This is done to implement the parsing of existing schemes.
- Many auxiliary functions to bring the difference between PEP 333 and PEP 3333 , as well as WSGI support on versions 2 and 3 of python.
Flask
- In Flask, the standard
json
module has been improved to combine support for versions 2 and 3 of python, as well as to provide various additional functions. It allows you to serialize common objects of type UUID or datetime
objects. - Improved work with the visibility of the application context. Now templates can be rendered only from the application context, and the main context
flask.g
is associated with it. This change simplifies the work, for example, with support for connecting to the database without being linked to the lifetime of HTTP requests. - Improved consistency of error handling by the framework.
- Added JSON serialization configuration options. For example, the order of the keys or "pretty-print" formatting.
Current version numbers: Flask - 0.10, Werkzeug - 0.9.
And, for statistics, due to the constantly growing support of the third python by various large projects, a poll (you can vote for several options).