The following issues were found

tests/basics/gen_yield_from_iter.py
4 issues
Missing function or method docstring
Error

Line: 1 Column: 1

              def gen():
    yield from (1, 2, 3)

def gen2():
    yield from gen()

def gen3():
    yield from (4, 5)
    yield 6

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              def gen():
    yield from (1, 2, 3)

def gen2():
    yield from gen()

def gen3():
    yield from (4, 5)
    yield 6

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              def gen():
    yield from (1, 2, 3)

def gen2():
    yield from gen()

def gen3():
    yield from (4, 5)
    yield 6

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 7 Column: 1

              def gen2():
    yield from gen()

def gen3():
    yield from (4, 5)
    yield 6

print(list(gen()))
print(list(gen2()))

            

Reported by Pylint.

tests/basics/gen_yield_from_send.py
4 issues
Assigning result of a function call, where the function has no return
Error

Line: 8 Column: 1

              def gen2():
    print((yield from gen()))

g = gen2()
next(g)
print("yielded:", g.send("val"))
try:
    next(g)
except StopIteration:

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              def gen():
    print("sent:", (yield 1))
    yield 2

def gen2():
    print((yield from gen()))

g = gen2()
next(g)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 1 Column: 1

              def gen():
    print("sent:", (yield 1))
    yield 2

def gen2():
    print((yield from gen()))

g = gen2()
next(g)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 5 Column: 1

                  print("sent:", (yield 1))
    yield 2

def gen2():
    print((yield from gen()))

g = gen2()
next(g)
print("yielded:", g.send("val"))

            

Reported by Pylint.

tests/basics/generator_return.py
4 issues
Missing module docstring
Error

Line: 1 Column: 1

              def gen():
    yield 1
    return 42

g = gen()
print(next(g))
try:
    print(next(g))
except StopIteration as e:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 1 Column: 1

              def gen():
    yield 1
    return 42

g = gen()
print(next(g))
try:
    print(next(g))
except StopIteration as e:

            

Reported by Pylint.

Variable name "e" doesn't conform to snake_case naming style
Error

Line: 9 Column: 1

              print(next(g))
try:
    print(next(g))
except StopIteration as e:
    print(type(e), e.args)

# trying next again should raise StopIteration with no arguments
try:
    print(next(g))

            

Reported by Pylint.

Variable name "e" doesn't conform to snake_case naming style
Error

Line: 15 Column: 1

              # trying next again should raise StopIteration with no arguments
try:
    print(next(g))
except StopIteration as e:
    print(type(e), e.args)

            

Reported by Pylint.

tests/basics/int_big_div.py
4 issues
Missing module docstring
Error

Line: 1 Column: 1

              for lhs in (1000000000000000000000000, 10000000000100000000000000, 10012003400000000000000007, 12349083434598210349871029923874109871234789):
    for rhs in range(1, 555):
        print(lhs // rhs)

# these check an edge case on 64-bit machines where two mpz limbs
# are used and the most significant one has the MSB set
x = 0x8000000000000000
print((x + 1) // x)
x = 0x86c60128feff5330

            

Reported by Pylint.

Line too long (141/100)
Error

Line: 1 Column: 1

              for lhs in (1000000000000000000000000, 10000000000100000000000000, 10012003400000000000000007, 12349083434598210349871029923874109871234789):
    for rhs in range(1, 555):
        print(lhs // rhs)

# these check an edge case on 64-bit machines where two mpz limbs
# are used and the most significant one has the MSB set
x = 0x8000000000000000
print((x + 1) // x)
x = 0x86c60128feff5330

            

Reported by Pylint.

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

Line: 7 Column: 1

              
# these check an edge case on 64-bit machines where two mpz limbs
# are used and the most significant one has the MSB set
x = 0x8000000000000000
print((x + 1) // x)
x = 0x86c60128feff5330
print((x + 1) // x)

# these check edge cases where borrow overflows

            

Reported by Pylint.

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

Line: 9 Column: 1

              # are used and the most significant one has the MSB set
x = 0x8000000000000000
print((x + 1) // x)
x = 0x86c60128feff5330
print((x + 1) // x)

# these check edge cases where borrow overflows
print((2 ** 48 - 1) ** 2 // (2 ** 48 - 1))
print((2 ** 256 - 2 ** 32) ** 2 // (2 ** 256 - 2 ** 32))

            

Reported by Pylint.

tests/basics/int_big_mod.py
4 issues
Missing module docstring
Error

Line: 1 Column: 1

              # test % operation on big integers

delta = 100000000000000000000000000000012345

for i in range(11):
    for j in range(11):
        x = delta * (i - 5)
        y = delta * (j - 5)
        if y != 0:

            

Reported by Pylint.

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

Line: 3 Column: 1

              # test % operation on big integers

delta = 100000000000000000000000000000012345

for i in range(11):
    for j in range(11):
        x = delta * (i - 5)
        y = delta * (j - 5)
        if y != 0:

            

Reported by Pylint.

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

Line: 14 Column: 1

              
# these check an edge case on 64-bit machines where two mpz limbs
# are used and the most significant one has the MSB set
x = 0x8000000000000000
print((x + 1) % x)
x = 0x86c60128feff5330
print((x + 1) % x)

            

Reported by Pylint.

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

Line: 16 Column: 1

              # are used and the most significant one has the MSB set
x = 0x8000000000000000
print((x + 1) % x)
x = 0x86c60128feff5330
print((x + 1) % x)

            

Reported by Pylint.

tests/basics/int_small.py
4 issues
Missing module docstring
Error

Line: 1 Column: 1

              # This tests small int range for 32-bit machine

# Small ints are variable-length encoded in MicroPython, so first
# test that encoding works as expected.

print(0)
print(1)
print(-1)
# Value is split in 7-bit "subwords", and taking into account that all

            

Reported by Pylint.

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

Line: 38 Column: 1

              print(-3)
print(~3)

a = 0x3fffff
print(a)
a *= 0x10
print(a)
a *= 0x10
print(a)

            

Reported by Pylint.

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

Line: 49 Column: 1

              # This would overflow
#a += 1

a = -0x3fffff
print(a)
a *= 0x10
print(a)
a *= 0x10
print(a)

            

Reported by Pylint.

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

Line: 81 Column: 1

              print(1 >> 128)

# These are runtime calcs
a = 1
print(a >> 32)
print(a >> 64)
print(a >> 128)

            

Reported by Pylint.

tests/basics/list_slice.py
4 issues
Missing module docstring
Error

Line: 1 Column: 1

              # test list slices, getting values

x = list(range(10))

print(x[1:])
print(x[:-1])
print(x[2:3])

a = 2

            

Reported by Pylint.

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

Line: 9 Column: 1

              print(x[:-1])
print(x[2:3])

a = 2
b = 4
c = 3
print(x[:])
print(x[::])
print(x[::c])

            

Reported by Pylint.

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

Line: 10 Column: 1

              print(x[2:3])

a = 2
b = 4
c = 3
print(x[:])
print(x[::])
print(x[::c])
print(x[:b])

            

Reported by Pylint.

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

Line: 11 Column: 1

              
a = 2
b = 4
c = 3
print(x[:])
print(x[::])
print(x[::c])
print(x[:b])
print(x[:b:])

            

Reported by Pylint.

tests/basics/list_sort.py
4 issues
Missing module docstring
Error

Line: 1 Column: 1

              l = [1, 3, 2, 5]

print(l)
print(sorted(l))
l.sort()
print(l)
print(l == sorted(l))

print(sorted(l, key=lambda x: -x))

            

Reported by Pylint.

Missing class docstring
Error

Line: 37 Column: 1

              print(l[0], l[-1])

# test user-defined ordering
class A:
    def __init__(self, x):
        self.x = x
    def __lt__(self, other):
        return self.x > other.x
    def __repr__(self):

            

Reported by Pylint.

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

Line: 37 Column: 1

              print(l[0], l[-1])

# test user-defined ordering
class A:
    def __init__(self, x):
        self.x = x
    def __lt__(self, other):
        return self.x > other.x
    def __repr__(self):

            

Reported by Pylint.

Attribute name "x" doesn't conform to snake_case naming style
Error

Line: 39 Column: 9

              # test user-defined ordering
class A:
    def __init__(self, x):
        self.x = x
    def __lt__(self, other):
        return self.x > other.x
    def __repr__(self):
        return str(self.x)
l = [A(5), A(2), A(1), A(3), A(4)]

            

Reported by Pylint.

tests/basics/op_error_literal.py
4 issues
Value '1' is unsubscriptable
Error

Line: 6 Column: 5

              
# unsupported subscription
try:
    1[0]
except TypeError:
    print("TypeError")
try:
    ""[""]
except TypeError:

            

Reported by Pylint.

Sequence index is not an int, slice, or instance with __index__
Error

Line: 10 Column: 5

              except TypeError:
    print("TypeError")
try:
    ""[""]
except TypeError:
    print("TypeError")

# not callable
try:

            

Reported by Pylint.

1 is not callable
Error

Line: 16 Column: 5

              
# not callable
try:
    1()
except TypeError:
    print("TypeError")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test errors from bad operations with literals
# these raise a SyntaxWarning in CPython; see https://bugs.python.org/issue15248

# unsupported subscription
try:
    1[0]
except TypeError:
    print("TypeError")
try:

            

Reported by Pylint.

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

Line: 9 Column: 5

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

print(set)

print(type(set()) == set)


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # set type

# This doesn't really work as expected, because {None}
# leads SyntaxError during parsing.
try:
    set
except NameError:
    print("SKIP")
    raise SystemExit

            

Reported by Pylint.

Using type() instead of isinstance() for a typecheck.
Error

Line: 13 Column: 7

              
print(set)

print(type(set()) == set)

print(type({None}) == set)

            

Reported by Pylint.

Using type() instead of isinstance() for a typecheck.
Error

Line: 15 Column: 7

              
print(type(set()) == set)

print(type({None}) == set)

            

Reported by Pylint.