diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2012-11-16 11:17:42 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2012-11-16 11:17:42 (GMT) |
commit | eb24b44ef494dde1564d642d39d460de4f4a2a3a (patch) | |
tree | 7dfee7eabee401e465dcfd0f02b77b5a3bedcfc6 | |
parent | 021f4c2ecca4e65755fc39b01b7819df8dd9993f (diff) | |
parent | 103f17ef918188ea2f50b01bb616953082d5f4e2 (diff) | |
download | cpython-eb24b44ef494dde1564d642d39d460de4f4a2a3a.zip cpython-eb24b44ef494dde1564d642d39d460de4f4a2a3a.tar.gz cpython-eb24b44ef494dde1564d642d39d460de4f4a2a3a.tar.bz2 |
#16478: merge with 3.2.
-rwxr-xr-x | Lib/tabnanny.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/tabnanny.py b/Lib/tabnanny.py index 4a54f89..5b9b444 100755 --- a/Lib/tabnanny.py +++ b/Lib/tabnanny.py @@ -188,21 +188,21 @@ class Whitespace: # count, il = self.norm # for i in range(len(count)): # if count[i]: - # il = il + (i/tabsize + 1)*tabsize * count[i] + # il = il + (i//tabsize + 1)*tabsize * count[i] # return il # quicker: - # il = trailing + sum (i/ts + 1)*ts*count[i] = - # trailing + ts * sum (i/ts + 1)*count[i] = - # trailing + ts * sum i/ts*count[i] + count[i] = - # trailing + ts * [(sum i/ts*count[i]) + (sum count[i])] = - # trailing + ts * [(sum i/ts*count[i]) + num_tabs] - # and note that i/ts*count[i] is 0 when i < ts + # il = trailing + sum (i//ts + 1)*ts*count[i] = + # trailing + ts * sum (i//ts + 1)*count[i] = + # trailing + ts * sum i//ts*count[i] + count[i] = + # trailing + ts * [(sum i//ts*count[i]) + (sum count[i])] = + # trailing + ts * [(sum i//ts*count[i]) + num_tabs] + # and note that i//ts*count[i] is 0 when i < ts count, trailing = self.norm il = 0 for i in range(tabsize, len(count)): - il = il + i/tabsize * count[i] + il = il + i//tabsize * count[i] return trailing + tabsize * (il + self.nt) # return true iff self.indent_level(t) == other.indent_level(t) |