Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9d2e7e01
Commit
9d2e7e01
authored
Nov 16, 2012
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Plain Diff
#16478: merge with 3.3.
parents
e4710cfc
eb24b44e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Lib/tabnanny.py
Lib/tabnanny.py
+8
-8
No files found.
Lib/tabnanny.py
View file @
9d2e7e01
...
...
@@ -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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment