Skip to content
Snippets Groups Projects
Commit 24140873 authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

check-code: lift the ban on 'next()'

'next' is supported by Python2.6 the new lowest version supported by Mercurial.
parent 3ea8d6b5
No related branches found
No related tags found
No related merge requests found
......@@ -217,8 +217,6 @@
(r'(\w|\)),\w', "missing whitespace after ,"),
(r'(\w|\))[+/*\-<>]\w', "missing whitespace in expression"),
(r'^\s+(\w|\.)+=\w[^,()\n]*$', "missing whitespace in assignment"),
(r'(?<!def)(\s+|^|\()next\(.+\)',
'no next(foo) in Python 2.4 and 2.5, use foo.next() instead'),
(r'(\s+)try:\n((?:\n|\1\s.*\n)*?)\1\s*yield\b.*?'
r'((?:\n|\1\s.*\n)+?)\1finally:',
'no yield inside try/finally in Python 2.4'),
......
......@@ -22,13 +22,6 @@
> if any():
> x = all()
> y = format(x)
> # next(generator) is new in 2.6
> z = next(x)
> # but generator.next() is okay
> x.next()
> # and we can make our own next
> def next(stuff):
> pass
>
> # Do not complain about our own definition
> def any(x):
......@@ -101,9 +94,6 @@
./non-py24.py:4:
> y = format(x)
any/all/format not available in Python 2.4
./non-py24.py:6:
> z = next(x)
no next(foo) in Python 2.4 and 2.5, use foo.next() instead
./non-py24.py:35:
./non-py24.py:28:
> try:
no yield inside try/finally in Python 2.4
......@@ -108,6 +98,6 @@
> try:
no yield inside try/finally in Python 2.4
./non-py24.py:40:
./non-py24.py:33:
> try:
no yield inside try/finally in Python 2.4
./classstyle.py:4:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment