This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients docs@python, ezio.melotti, georg.brandl, mrabarnett, sjmachin
Date 2012-01-31.13:13:09
SpamBayes Score 3.3382552e-08
Marked as misclassified No
Message-id <1328015590.57.0.567266081962.issue13899@psf.upfronthosting.co.za>
In-reply-to
Content
The rule 1 makes sense, but it's not entirely obvious (people might consider bBaAzZ special too).

The "normal Python rules for backslash escapes but revert to the C behaviour of stripping the \ from unrecognised escapes" is not obvious either, and from r'[\A]' people might expect:
  1) same as \A, (beginning of the string);
  2) a letter 'A';
  3) a '\' or a letter 'A' (especially if they write it as '[\\A]');

This is why I suggested to raise an error (and refuse the temptation to guess), but on the other hand, if you consider 'A' a "normal" letter like 'C', having an error for \A would be incoherent.
It would have been better if \C raised an error too (I don't see why that would appear in a regex, since re.escape doesn't escape C and the user has no reason to add the \), but now it's too late for that.
History
Date User Action Args
2012-01-31 13:13:10ezio.melottisetrecipients: + ezio.melotti, georg.brandl, sjmachin, mrabarnett, docs@python
2012-01-31 13:13:10ezio.melottisetmessageid: <1328015590.57.0.567266081962.issue13899@psf.upfronthosting.co.za>
2012-01-31 13:13:10ezio.melottilinkissue13899 messages
2012-01-31 13:13:09ezio.melotticreate