The above is a very simple bit of code on a Raspberry, in python and if you look at the setupLED(leds) on line 22 this is where it fails but I just can't get my head around why if I write it out in long format (setupLED(0), setupLED(1) etc..) it works...