I think currently there might be a bug with setting a lamp’s distance through python.
When using the official 2.71 release and newer builds (including today’s buildbot version hash 698a9a2), attempting to set a point (or spot) lamp’s distance sets the lamp’s energy instead.
I mainly use Ubuntu, but I’ve tested this on Win7 as well (both 32-bit) and get the same results.
It works for me as expected on 2.70a however.
I’ve attached a .blend file that shows what I’m describing.
lightDistanceBug.blend (402 KB)
The example uses a point lamp, but the results are the same if you change it to a spot lamp.
I’d appreciate it if someone else could verify this behavior as well (maybe on a 64-bit system or OSx), to confirm that it is in fact a bug and not something specific to my working environment, before I submit this to the bug tracker.
Proposed a revision for this bug, and it has since been reviewed and committed to master [a21a9dd]