Drop Python 2#1693
Conversation
|
Well, I've only been looking forward to doing this for 2 years, but ok, you get the pr 😉 This will be in 2, so I can't merge it until after 1 is released. |
|
Since we're supporting 3.6+, we can use f-strings everywhere. Can drop u prefix. I'd like to investigate moving away from supporting both bytes and text as arguments everywhere, as Python 3 should have much clearer delineation between where those types should be present. In the past there was an issue about Pallets being much slower after the 2/3 compat transition, that was caused by the constant type checking and conversion that had to be added. This can be a separate ticket though. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
183cd6f to
e87b963
Compare
|
I did some cleanup of the helpers we kept from Replaced Removed Removed the |
This comment has been minimized.
This comment has been minimized.
This removes the official support for 2.7 without making any code changes. It allows for code changes to be made.
This is possible now that Python 2 is not supported. The code that is still required has been moved to the _internal module and renamed with a leading `_` as per the other functions. As this change is targeting Werkzeug 2.0 the compatibility with 3.5 is dropped, 2.0 will be Python 3.6+.
The latter is clearer in a Python3 context.
This has replaced a lot of Python2 idioms with Python3.6 idioms (see https://github.com/asottile/pyupgrade).
serving._SSLContext wrapper SharedDataMiddleware loader compat deprecate http decode/encode_keys argument use of detect_utf_encoding for json code paths with Python < 3.6 comments except ImportError fallbacks sys.version_info checks use platform.system() mentions of Python 2 compat in some docs and comments
remove to_native call where possible rename normalize_string_tuple to check_str_tuple rename make_literal_wrapper to make_encode_wrapper
Obsoleted as of pallets#1693 Drop Python 2.
Obsoleted as of pallets#1693 Drop Python 2.
Python 2 support was dropped in pallets#1693. * Remove superfluous __ne__ and __cmp__ implementations. * Use no-arg super() rather than 2-arg super(...).
Python 2 support was dropped in pallets#1693. * Remove superfluous __ne__ and __cmp__ implementations. * Use no-arg super() rather than 2-arg super(...). Also improve associated tests.
Python 2 support was dropped in pallets#1693. * Remove superfluous __ne__ and __cmp__ implementations. * Use no-arg super() rather than 2-arg super(...). Also improve associated tests.
I'm not sure what release this will be in, 1, 1.1, 2?