Today, this question was posted on the global meta pointing out a comment that was blocked for beginning with the text "-1" even though the comment was not referring to the user's vote. To account for such false positives, as well as cases where someone is giving constructive feedback, there's an exemption in place so that comments matching the regex that are longer than 120 characters (i.e., are 121 or more characters long) will not be blocked.
However, the comment in that question is exactly 121 characters long, but it was still blocked. Here's the comment they were trying to post:
Text representation:
"-1" is a valid list index in Python - make sure to check. A good example why other languages have optional return types.
It appears that this exemption filter isn't working as documented.
1
in order for the comment to not be blocked. The limit for "+1" is that there needs to be at least an additional 102 characters after the1
character in order for the comment to not be blocked.str.find
's behaviour of returning-1
when the substring is not found - it would have been better to point out that this is a valid string index. It works like that because it's such an old part of the language, and early developers who were influenced by C didn't think about it very hard. Theindex
method of strings (or lists) doesn't repeat this flaw. That said, Python offers all sorts of ways to signal out-of-band return values, and "optional return type" is basically meaningless in a language with dynamic typing.