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
d1c69c21
Commit
d1c69c21
authored
Aug 25, 2003
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added doubled word warnings.
parent
9efcbced
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
1 deletion
+6
-1
Doc/ref/ref3.tex
Doc/ref/ref3.tex
+1
-1
Misc/NEWS
Misc/NEWS
+2
-0
Tools/scripts/texcheck.py
Tools/scripts/texcheck.py
+3
-0
No files found.
Doc/ref/ref3.tex
View file @
d1c69c21
...
...
@@ -1740,7 +1740,7 @@ in a negative index); this is the customary handling of negative
indexes by the built-in sequence types, and the
\method
{__
*item
__
()
}
methods are expected to do this as well. However, since they should
already be doing that, negative indexes cannot be passed in; they must
be
be
constrained to the bounds of the sequence before being passed to
be constrained to the bounds of the sequence before being passed to
the
\method
{__
*item
__
()
}
methods.
Calling
\code
{
max(0, i)
}
conveniently returns the proper value.
...
...
Misc/NEWS
View file @
d1c69c21
...
...
@@ -55,6 +55,8 @@ Library
Tools
/
Demos
-----------
-
texcheck
.
py
now
detects
double
word
errors
.
-
md5sum
.
py
mistakenly
opened
input
files
in
text
mode
by
default
,
a
silent
and
dangerous
change
from
previous
releases
.
It
once
again
opens
input
files
in
binary
mode
by
default
.
The
-
t
and
-
b
flags
...
...
Tools/scripts/texcheck.py
View file @
d1c69c21
...
...
@@ -98,6 +98,7 @@ def checkit(source, opts, morecmds=[]):
delimiters
=
re
.
compile
(
r'\\(begin|end){([_a-zA-Z]+)}|([()\
[
\]])'
)
braces
=
re
.
compile
(
r'({)|(})'
)
doubledwords
=
re
.
compile
(
r'(\b[A-za-z]+\b) \b\1\b'
)
openers
=
[]
# Stack of pending open delimiters
bracestack
=
[]
# Stack of pending open braces
...
...
@@ -175,6 +176,8 @@ def checkit(source, opts, morecmds=[]):
if '
e
.
g
.
' in line or '
i
.
e
.
' in line:
print r'
Style
warning
,
avoid
use
of
i
.
e
or
e
.
g
.
on
line
%
d
' % (lineno,)
for dw in doubledwords.findall(line):
print r'
Doubled
word
warning
.
"%s"
on
line
%
d
' % (dw, lineno)
lastline = lineno
for lineno, symbol in openers:
...
...
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