indentation bug

Editor
Nov 30, 2011 at 4: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):
            l.append(1)
            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):
                subSet.append(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 Program.py    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.
Coordinator
Nov 30, 2011 at 5:11 PM

Thanks for a report - I can repro this and opened a bug: http://pytools.codeplex.com/workitem/602  I'll try and get it fixed for the beta.

Coordinator
Nov 30, 2011 at 6:46 PM

I've checked in the fix for this - http://pytools.codeplex.com/SourceControl/changeset/changes/a5a5da9f799c

 

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.