[New-bugs-announce] [issue30363] Backport warnings in the re module to 2.7
report at bugs.python.org
Sun May 14 08:16:10 EDT 2017
New submission from Serhiy Storchaka:
The life of 2.7 is so long that our common practice of releasing one or two versions with warnings before removing a feature or changing the behavior in incompatible way doesn't work. People that will start porting to Python 3 in 2020 will be surprised.
Proposed patch backports warnings in the re module to 2.7 in py3k mode. Some of these warnings already are converted to errors, but the most important warnings are warnings about changing semantic. '\u' and '\U' have different meaning in 3.3+ (see issue3665). re.split() with potentially empty pattern now emits FutureWarning and will change the behavior in future versions (see issue22818).
Warnings about inline flags occurred not at the start of the regular expression (see issue22493 and issue30298) was not backported. Adding them requires changing the fnmatch module, non-trivially changing distutils, and likely will break third-party libraries.
Warnings are emitted only when Python is ran with the -3 option, and it is easy to fix regular expressions.
components: Extension Modules, Library (Lib), Regular Expressions
nosy: benjamin.peterson, ezio.melotti, mrabarnett, serhiy.storchaka
stage: patch review
title: Backport warnings in the re module to 2.7
versions: Python 2.7
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce