This project has moved and is read-only. For the latest updates, please go here.

indentation bug

Nov 30, 2011 at 5:24 PM

Given the code

def allSum(number): 
    sume = 0    
    combinations = set()
    current = []
    solve(number, 1, combinations, current)
    print combinations

def solve(number, start, combinations, current):

    if start == number : return
    for i in xrange(start,number):
        print i
        solve(number, start, combinations, current)
def fun(x):
    s = 1
    for i in xrange(1,x+1):
        s = s * i
        l = []
        for i in xrange(x):
            yield l
            l = []
            for j in xrange(s):
                tmp = j
                while(tmp != 0):
                    l.append(tmp % x)
                    tmp = tmp / x
                    if(sum(l) == x and (not in l)):
                        yield l 
def allSum(number):
    mask = [0] * number
    for i in xrange(2**number):
        subSet = []
        for j in xrange(number):
            if i & (2**j):
        #if sum(subSet) == number:
           yield subSet

for i in allSum(4):
    print i                                                                      
for j in xrange(4):
    print 2 ** j  
VS shows Error    1    unindent does not match any outer indentation level    5    5    
But the error is in 44 line (yield subSet), the problem is I have two functions with the same signature which is fine for Python, but not for VS code analyzer.
Nov 30, 2011 at 6:11 PM

Thanks for a report - I can repro this and opened a bug:  I'll try and get it fixed for the beta.

Nov 30, 2011 at 7:46 PM

I've checked in the fix for this -


The issue was w/ the tokenizer reporting the wrong index, it was reporting an index into the buffer, not the index into the file, and this file is big enough that we re-fill the buffer so the position is wrong.