tests/test-check-code.t
changeset 18183 e1caaeb5a2ed
parent 18180 c582a71457e5
child 18762 a91387a37f05
equal deleted inserted replaced
18182:e6db64abfa87 18183:e1caaeb5a2ed
   108    old-style class, use class foo(object)
   108    old-style class, use class foo(object)
   109   ./classstyle.py:7:
   109   ./classstyle.py:7:
   110    > class empty():
   110    > class empty():
   111    class foo() not available in Python 2.4, use class foo(object)
   111    class foo() not available in Python 2.4, use class foo(object)
   112   [1]
   112   [1]
       
   113   $ cat > python3-compat.py << EOF
       
   114   > foo <> bar
       
   115   > reduce(lambda a, b: a + b, [1, 2, 3, 4])
       
   116   > EOF
       
   117   $ "$check_code" python3-compat.py
       
   118   python3-compat.py:1:
       
   119    > foo <> bar
       
   120    <> operator is not available in Python 3+, use !=
       
   121   python3-compat.py:2:
       
   122    > reduce(lambda a, b: a + b, [1, 2, 3, 4])
       
   123    reduce is not available in Python 3+
       
   124   [1]
   113 
   125 
   114   $ cat > is-op.py <<EOF
   126   $ cat > is-op.py <<EOF
   115   > # is-operator comparing number or string literal
   127   > # is-operator comparing number or string literal
   116   > x = None
   128   > x = None
   117   > y = x is 'foo'
   129   > y = x is 'foo'