[issue22364] Unify error messages of re and regex

2014-09-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, Sep 19, 2014 at 08:41:57PM +, Mark Lawrence wrote: > I do not believe that any changes should be made to the re module > until such time as there is a fully approved PEP [] Why is this so controversial? We're not talking about functional change

[issue22364] Unify error messages of re and regex

2014-09-19 Thread Mark Lawrence
Mark Lawrence added the comment: The key word is "potential". I do not believe that any changes should be made to the re module until such time as there is a fully approved PEP for the regex module and that work has actually started on getting it into the stdlib. Surely backward compatibilit

[issue22364] Unify error messages of re and regex

2014-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The regex module is potential candidate for replacement of the re module. -- ___ Python tracker ___ __

[issue22364] Unify error messages of re and regex

2014-09-18 Thread Mark Lawrence
Mark Lawrence added the comment: How can anything that's in the stdlib be unified with something that's not in the stdlib and currently has no prospects of getting in the stdlib? -- nosy: +BreamoreBoy ___ Python tracker

[issue22364] Unify error messages of re and regex

2014-09-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: I prefer "cannot" for error messages. "Can't" is an informal version of "cannot", used in speech, dialog representing speech, and 'informal' writing. It looks wrong to me in this context. -- nosy: +terry.reedy ___

[issue22364] Unify error messages of re and regex

2014-09-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > By the way, which is preferred, "cannot" or "can't"? The regex module always > uses "can't", but re module uses "cannot" except for "TypeError: can't use > a bytes pattern on a string-like object", I think. It's interesting question. Grepping in CPython sour

[issue22364] Unify error messages of re and regex

2014-09-09 Thread Matthew Barnett
Matthew Barnett added the comment: > re:Cannot process flags argument with a compiled pattern > regex: can't process flags argument with a compiled pattern Error messages usually start with a lowercase letter, and I think that all the other ones in the re module do. By the way, which is pr

[issue22364] Unify error messages of re and regex

2014-09-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, the idea of this issue is to enhance the re module (and the regex module if Matthew will) be picking the best error messages (or writing a new one). -- assignee: -> serhiy.storchaka ___ Python tracker

[issue22364] Unify error messages of re and regex

2014-09-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm dubious about this issue. It suggests that the wording of the exceptions is part of the API of the two modules. If the idea is just to copy the best error messages from one module to the other, then I guess there is no harm. But if the idea is to guarante

[issue22364] Unify error messages of re and regex

2014-09-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 18. re.compile(r'.???') re:multiple repeat regex: nothing to repeat at position 3 -- ___ Python tracker ___ _

[issue22364] Unify error messages of re and regex

2014-09-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: In some cases standard re module and third-party regex modules raise exceptions with different error messages. 1. re.match(re.compile('.'), 'A', re.I) re:Cannot process flags argument with a compiled pattern regex: can't process flags argument with