14

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.

5
  • From what I can see the actual block pattern and the description in the linked answer are not quite in sync... It would only take a few more characters here to be able to post this comment. (I'm trying not to give too much specifically here; let me see what else about this block is public)
    – Henry Ecker Mod
    Nov 19 at 19:04
  • @HenryEcker So, in other words, either the answer author or the regex author mistyped the character limit?
    – gparyani
    Nov 19 at 19:07
  • Right, so as Makyen mentions the 120 character count starts after the "-1". In the example here 4 more characters is enough to let it pass. Whether that's the intended behvaiour of the pattern and the description is wrong, or the intention was to restrict on total comment length and the pattern is incorrect is unknown.
    – Henry Ecker Mod
    Nov 19 at 19:10
  • @HenryEcker That's not actually correct. The limit for "-1" is that there needs to be at least an additional 122 characters after the character 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 the 1 character in order for the comment to not be blocked.
    – Makyen Mod
    Nov 19 at 19:13
  • Assuming you were talking about 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. The index 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. Nov 19 at 20:52

1 Answer 1

13

The English description in this post of the block was not quite accurate, but it was quite close. The actual restriction is that there must be more than 121 characters after the "1" in "-1". I've updated the description in that post and included the detail that there needs to be more than 101 characters after the "1" character in "+1" in order for the block not to be applied.

I should note that it's possible that the original English description might have been the overall intent, and would have more accurately matched the data presented in the above linked answer. However, the difference in required length between "+1" and "-1" implies that the blocklist entries are the actual intent. In addition, the difference is relatively minor in the "-1" case, and it's considerably easier to adjust the English description in the linked answer than it is to adjust the blocklist entries.

5
  • "more than 121" means 122 or more, correct?
    – gparyani
    Nov 19 at 19:10
  • Yes, if there are 122 or more characters after the "1" character, it should not be blocked.
    – Makyen Mod
    Nov 19 at 19:11
  • FYI, your second paragraph is why I retagged this as a support question and removed the request for it to be fixed.
    – gparyani
    Nov 19 at 23:14
  • Also, see this related comment thread from Shog9, which took place today. The reduction by 20 characters in "+1" is because Shog kept re-adjusting the thresholds as he saw.
    – gparyani
    Nov 19 at 23:15
  • @gparyani the good old days of people giving themselves personal responsibilities to keep it a well-oiled machine. Alas, that was never meant to last.
    – Gimby
    Nov 21 at 14:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .