Just finished a massive PR to deprecate bytes and charsets other than UTF-8 in Werkzeug 2.3. (You can still work with raw bytes in requests/responses, so it's still possible to use other charsets.) Surprisingly, very few tests failed due to it, which was a relief. Looking forward to making the PR removing all the deprecations 😈 https://github.com/pallets/werkzeug/pull/2641 #Python #Flask #Werkzeug #PythonFlask #PythonWerkzeug
deprecate bytes and charset by davidism · Pull Request #2641 · pallets/werkzeug

This deprecates everywhere that accepted bytes when str was the correct type. It also deprecates the charset and errors parameters throughout the code. Closes #2602, which has more of my reasoning ...

GitHub

Last year at PyCon US 2022, @tonybaloney ran a basic benchmark of Flask. I finally got around to it, and achieved a ✨ 35% ✨ speedup to routing and environ processing.

Due to Python 2/3, Werkzeug had its own modified copy of `urlparse`/`urllib.parse`, with a lot of unnecessary encoding/decoding due to str/bytes support. I finally replaced that with the standard library, and got a huge speed boost.

https://github.com/pallets/werkzeug/pull/2608

#Python #Flask #PythonFlask #PythonWerkzeug

replace calls to `werkzeug.urls` with `urllib.parse` by davidism · Pull Request #2608 · pallets/werkzeug

Use urllib.parse functions instead of our own implementation. Deprecate all of werkzeug.urls except for uri_to_iri and iri_to_uri. My benchmark shows a 35% speedup in routing and responses, 8% from...

GitHub