[issue22364] Improve some re error messages using regex for hints

Serhiy Storchaka report at bugs.python.org
Fri Feb 20 09:59:21 CET 2015


Serhiy Storchaka added the comment:

> Messages tend to be abbreviated, so I think that it would be better to just
> omit the article.

I agree, but this is came from standard error messages which are not 
consistent. I opened a thread on Python-Dev.

"expected a bytes-like object" and "expected str instance" are standard error 
messages raised in bytes.join and str.join, not in re. We could change them 
though.

> I don't think that the error message "bad repeat interval" is an improvement
> (Why is it "bad"? What is an "interval"?). I think that saying that the min
> is greater than the max is clearer.

Agree. I'll change this in re. What message is better in case of overflow: "the 
repetition number is too large" (in re) or "repeat count too big" (in regex)?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22364>
_______________________________________


More information about the Python-bugs-list mailing list