Different behaviour of regexp in 3.6.0b2

Chris Angelico rosuav at gmail.com
Fri Oct 14 12:59:51 EDT 2016


On Sat, Oct 15, 2016 at 3:45 AM, Lele Gaifax <lele at metapensiero.it> wrote:
> Chris Angelico <rosuav at gmail.com> writes:
>
>> There's a shift as of 3.6 to make unrecognized alphabetic escapes into
>> errors, or at least warnings.
>
> But we are talking about raw strings here, specifically r'\s+'.
>
> I agree that with plain strings it's a plus.

Right; the main change is for non-raw string literals, but it looks
like the same change was made to regular expressions at the same time.
IMO that's a good thing - the rule is simply "starting with 3.6, you
should avoid \Z for any upper- or lower-case Z that doesn't have a
documented meaning".

ChrisA



More information about the Python-list mailing list