13

A question on SO (10k-only link) that recently got some attention due to a meta post consisted entirely of python code, no additional text was present in the question body. This should theoretically have triggered the “Here code. You fix.” filter that should prevent questions that only contain source code.

This didn't work in this case, the entire question body was:

    import math
def is_Prime(x):

    if ((x&1)) :
        for c in range (2,int(math.sqrt(x),+1)
                        if ( x%c == 0 ):
                          print ("not prime")






is_Prime(77)

I'm wondering if the whitespace might have thrown the filter off. There might be a loophole here to evade the filter. If it's an easy fix it might be worth it to close the loophole, I don't expect the filter to be perfect, but this example looks like something it should be able to catch.

1
  • 3
    It pains me to see that block of code and know that formatting it would be the wrong thing to do.
    – Pops
    Commented Dec 9, 2011 at 15:20

1 Answer 1

8

The 2nd and last lines were not indented so looked like text to the filter. He got the first line indented by accident. Nothing malicious, just clumsiness.

A substantial amount of user effort in answering this question got deleted. I wonder if that was the right call.

1
  • 2
    I don't think the filter depends on correctly formatting the code as code, most of the questions it's designed to catch don't have any propoer code formatting. Commented Dec 9, 2011 at 12:12

You must log in to answer this question.

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