The following issues were found

tests/micropython/viper_binop_comp_imm.py
5 issues
Undefined variable 'micropython'
Error

Line: 2 Column: 2

              # comparisons with immediate boundary values
@micropython.viper
def f(a: int):
    print(a == -1, a == -255, a == -256, a == -257)


f(-1)
f(-255)
f(-256)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # comparisons with immediate boundary values
@micropython.viper
def f(a: int):
    print(a == -1, a == -255, a == -256, a == -257)


f(-1)
f(-255)
f(-256)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 3 Column: 1

              # comparisons with immediate boundary values
@micropython.viper
def f(a: int):
    print(a == -1, a == -255, a == -256, a == -257)


f(-1)
f(-255)
f(-256)

            

Reported by Pylint.

Argument name "a" doesn't conform to snake_case naming style
Error

Line: 3 Column: 1

              # comparisons with immediate boundary values
@micropython.viper
def f(a: int):
    print(a == -1, a == -255, a == -256, a == -257)


f(-1)
f(-255)
f(-256)

            

Reported by Pylint.

Function name "f" doesn't conform to snake_case naming style
Error

Line: 3 Column: 1

              # comparisons with immediate boundary values
@micropython.viper
def f(a: int):
    print(a == -1, a == -255, a == -256, a == -257)


f(-1)
f(-255)
f(-256)

            

Reported by Pylint.

tests/basics/iter2.py
5 issues
Missing module docstring
Error

Line: 1 Column: 1

              # user defined iterator used in something other than a for loop

class MyStopIteration(StopIteration):
    pass

class myiter:
    def __init__(self, i):
        self.i = i


            

Reported by Pylint.

Missing class docstring
Error

Line: 3 Column: 1

              # user defined iterator used in something other than a for loop

class MyStopIteration(StopIteration):
    pass

class myiter:
    def __init__(self, i):
        self.i = i


            

Reported by Pylint.

Class name "myiter" doesn't conform to PascalCase naming style
Error

Line: 6 Column: 1

              class MyStopIteration(StopIteration):
    pass

class myiter:
    def __init__(self, i):
        self.i = i

    def __iter__(self):
        return self

            

Reported by Pylint.

Missing class docstring
Error

Line: 6 Column: 1

              class MyStopIteration(StopIteration):
    pass

class myiter:
    def __init__(self, i):
        self.i = i

    def __iter__(self):
        return self

            

Reported by Pylint.

Unnecessary "elif" after "raise"
Error

Line: 14 Column: 9

                      return self

    def __next__(self):
        if self.i == 0:
            raise StopIteration
        elif self.i == 1:
            raise StopIteration(1)
        elif self.i == 2:
            raise MyStopIteration

            

Reported by Pylint.

tests/basics/builtin_setattr.py
4 issues
Too few public methods (0/2)
Error

Line: 1 Column: 1

              class A:

    var = 132

    def __init__(self):
        self.var2 = 34


a = A()

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              class A:

    var = 132

    def __init__(self):
        self.var2 = 34


a = A()

            

Reported by Pylint.

Missing class docstring
Error

Line: 1 Column: 1

              class A:

    var = 132

    def __init__(self):
        self.var2 = 34


a = A()

            

Reported by Pylint.

Class name "A" doesn't conform to PascalCase naming style
Error

Line: 1 Column: 1

              class A:

    var = 132

    def __init__(self):
        self.var2 = 34


a = A()

            

Reported by Pylint.

tests/basics/builtin_sorted.py
4 issues
Statement seems to have no effect
Error

Line: 3 Column: 5

              # test builtin sorted
try:
    sorted
    set
except:
    print("SKIP")
    raise SystemExit

print(sorted(set(range(100))))

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 4 Column: 5

              # test builtin sorted
try:
    sorted
    set
except:
    print("SKIP")
    raise SystemExit

print(sorted(set(range(100))))

            

Reported by Pylint.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 7 Column: 5

                  set
except:
    print("SKIP")
    raise SystemExit

print(sorted(set(range(100))))
print(sorted(set(range(100)), key=lambda x: x + 100*(x % 2)))

# need to use keyword argument

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test builtin sorted
try:
    sorted
    set
except:
    print("SKIP")
    raise SystemExit

print(sorted(set(range(100))))

            

Reported by Pylint.

tests/basics/builtin_zip.py
4 issues
Statement seems to have no effect
Error

Line: 2 Column: 5

              try:
    zip
    set
except NameError:
    print("SKIP")
    raise SystemExit

print(list(zip()))
print(list(zip([1], set([2, 3]))))

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 3 Column: 5

              try:
    zip
    set
except NameError:
    print("SKIP")
    raise SystemExit

print(list(zip()))
print(list(zip([1], set([2, 3]))))

            

Reported by Pylint.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 6 Column: 5

                  set
except NameError:
    print("SKIP")
    raise SystemExit

print(list(zip()))
print(list(zip([1], set([2, 3]))))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    zip
    set
except NameError:
    print("SKIP")
    raise SystemExit

print(list(zip()))
print(list(zip([1], set([2, 3]))))

            

Reported by Pylint.

tests/basics/bytearray1.py
4 issues
TODO: other comparisons
Error

Line: 53 Column: 3

              # comparison with other type should return False
print(bytearray() == 1)

# TODO: other comparisons

# __contains__
b = bytearray(b"\0foo\0")
print(b"foo" in b)
print(b"foo\x01" in b)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              print(bytearray(4))
a = bytearray([1, 2, 200])
print(type(a))
print(a[0], a[2])
print(a[-1])
print(a)
a[2] = 255
print(a[-1])
a.append(10)

            

Reported by Pylint.

Constant name "s" doesn't conform to UPPER_CASE naming style
Error

Line: 12 Column: 1

              a.append(10)
print(len(a))

s = 0
for i in a:
    s += i
print(s)

print(a[1:])

            

Reported by Pylint.

Comparison should be bytearray([1]) == b'1'
Error

Line: 27 Column: 7

              print(bytearray([1]) == bytearray([1]))
print(bytearray([1]) == bytearray([2]))
print(bytearray([1]) == b"1")
print(b"1" == bytearray([1]))
print(bytearray() == bytearray())

b1 = bytearray([1, 2, 3])
b2 = bytearray([1, 2, 3])
b3 = bytearray([1, 3])

            

Reported by Pylint.

tests/basics/bytes_compare_bytearray.py
4 issues
Comparison should be bytearray(b'123') == b'123'
Error

Line: 1 Column: 7

              print(b"123" == bytearray(b"123"))
print(b'123' < bytearray(b"124"))
print(b'123' > bytearray(b"122"))
print(bytearray(b"23") in b"1234")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              print(b"123" == bytearray(b"123"))
print(b'123' < bytearray(b"124"))
print(b'123' > bytearray(b"122"))
print(bytearray(b"23") in b"1234")

            

Reported by Pylint.

Comparison should be bytearray(b'124') > b'123'
Error

Line: 2 Column: 7

              print(b"123" == bytearray(b"123"))
print(b'123' < bytearray(b"124"))
print(b'123' > bytearray(b"122"))
print(bytearray(b"23") in b"1234")

            

Reported by Pylint.

Comparison should be bytearray(b'122') < b'123'
Error

Line: 3 Column: 7

              print(b"123" == bytearray(b"123"))
print(b'123' < bytearray(b"124"))
print(b'123' > bytearray(b"122"))
print(bytearray(b"23") in b"1234")

            

Reported by Pylint.

tests/basics/bytes_count.py
4 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 5 Column: 5

                  bytes.count
except AttributeError:
    print("SKIP")
    raise SystemExit

print(b"".count(b""))
print(b"".count(b"a"))
print(b"a".count(b""))
print(b"a".count(b"a"))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    bytes.count
except AttributeError:
    print("SKIP")
    raise SystemExit

print(b"".count(b""))
print(b"".count(b"a"))
print(b"a".count(b""))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 51 Column: 1

              print(b"aaaa".count(b'a', -1, 5))
print(b"abbabba".count(b"abba"))

def t():
    return True

print(b"0000".count(b'0', t()))

            

Reported by Pylint.

Function name "t" doesn't conform to snake_case naming style
Error

Line: 51 Column: 1

              print(b"aaaa".count(b'a', -1, 5))
print(b"abbabba".count(b"abba"))

def t():
    return True

print(b"0000".count(b'0', t()))

            

Reported by Pylint.

tests/basics/class_emptybases.py
4 issues
Missing class docstring
Error

Line: 1 Column: 1

              class A():
    pass

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              class A():
    pass

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 1 Column: 1

              class A():
    pass

            

Reported by Pylint.

Class name "A" doesn't conform to PascalCase naming style
Error

Line: 1 Column: 1

              class A():
    pass

            

Reported by Pylint.

tests/basics/class_inplace_op2.py
4 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 56 Column: 5

                  a *= None
except TypeError:
    print("SKIP")
    raise SystemExit

a @= None
a //= None
a /= None
a %= None

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # Test inplace special methods enabled by MICROPY_PY_ALL_INPLACE_SPECIAL_METHODS


class A:
    def __imul__(self, other):
        print("__imul__")
        return self

    def __imatmul__(self, other):

            

Reported by Pylint.

Missing class docstring
Error

Line: 4 Column: 1

              # Test inplace special methods enabled by MICROPY_PY_ALL_INPLACE_SPECIAL_METHODS


class A:
    def __imul__(self, other):
        print("__imul__")
        return self

    def __imatmul__(self, other):

            

Reported by Pylint.

Class name "A" doesn't conform to PascalCase naming style
Error

Line: 4 Column: 1

              # Test inplace special methods enabled by MICROPY_PY_ALL_INPLACE_SPECIAL_METHODS


class A:
    def __imul__(self, other):
        print("__imul__")
        return self

    def __imatmul__(self, other):

            

Reported by Pylint.