The following issues were found

tests/cpydiff/core_class_superproperty.py
8 issues
Line too long (101/100)
Error

Line: 3 Column: 1

              """
categories: Core,Classes
description: Calling super() getter property in subclass will return a property object, not the value
cause: Unknown
workaround: Unknown
"""


class A:

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 9 Column: 1

              """


class A:
    @property
    def p(self):
        return {"a": 10}



            

Reported by Pylint.

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

Line: 9 Column: 1

              """


class A:
    @property
    def p(self):
        return {"a": 10}



            

Reported by Pylint.

Missing class docstring
Error

Line: 9 Column: 1

              """


class A:
    @property
    def p(self):
        return {"a": 10}



            

Reported by Pylint.

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

Line: 11 Column: 5

              
class A:
    @property
    def p(self):
        return {"a": 10}


class AA(A):
    @property

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 11 Column: 5

              
class A:
    @property
    def p(self):
        return {"a": 10}


class AA(A):
    @property

            

Reported by Pylint.

Missing class docstring
Error

Line: 15 Column: 1

                      return {"a": 10}


class AA(A):
    @property
    def p(self):
        return super().p



            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 15 Column: 1

                      return {"a": 10}


class AA(A):
    @property
    def p(self):
        return super().p



            

Reported by Pylint.

tests/cpydiff/core_generator_noexit.py
8 issues
Class 'foo' inherits from object, can be safely removed from bases in python3
Error

Line: 9 Column: 1

              """


class foo(object):
    def __enter__(self):
        print("Enter")

    def __exit__(self, *args):
        print("Exit")

            

Reported by Pylint.

Black listed name "foo"
Error

Line: 9 Column: 1

              """


class foo(object):
    def __enter__(self):
        print("Enter")

    def __exit__(self, *args):
        print("Exit")

            

Reported by Pylint.

Missing class docstring
Error

Line: 9 Column: 1

              """


class foo(object):
    def __enter__(self):
        print("Enter")

    def __exit__(self, *args):
        print("Exit")

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 17 Column: 1

                      print("Exit")


def bar(x):
    with foo():
        while True:
            x += 1
            yield x


            

Reported by Pylint.

Black listed name "bar"
Error

Line: 17 Column: 1

                      print("Exit")


def bar(x):
    with foo():
        while True:
            x += 1
            yield x


            

Reported by Pylint.

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

Line: 17 Column: 1

                      print("Exit")


def bar(x):
    with foo():
        while True:
            x += 1
            yield x


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 24 Column: 1

                          yield x


def func():
    g = bar(0)
    for _ in range(3):
        print(next(g))



            

Reported by Pylint.

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

Line: 25 Column: 5

              

def func():
    g = bar(0)
    for _ in range(3):
        print(next(g))


func()

            

Reported by Pylint.

ports/qemu-arm/test-frzmpy/native_frozen_align.py
8 issues
Unable to import 'micropython'
Error

Line: 1 Column: 1

              import micropython


@micropython.native
def native_x(x):
    print(x + 1)


@micropython.native

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import micropython


@micropython.native
def native_x(x):
    print(x + 1)


@micropython.native

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 5 Column: 1

              

@micropython.native
def native_x(x):
    print(x + 1)


@micropython.native
def native_y(x):

            

Reported by Pylint.

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

Line: 5 Column: 1

              

@micropython.native
def native_x(x):
    print(x + 1)


@micropython.native
def native_y(x):

            

Reported by Pylint.

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

Line: 10 Column: 1

              

@micropython.native
def native_y(x):
    print(x + 1)


@micropython.native
def native_z(x):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 10 Column: 1

              

@micropython.native
def native_y(x):
    print(x + 1)


@micropython.native
def native_z(x):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 15 Column: 1

              

@micropython.native
def native_z(x):
    print(x + 1)

            

Reported by Pylint.

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

Line: 15 Column: 1

              

@micropython.native
def native_z(x):
    print(x + 1)

            

Reported by Pylint.

tests/cmdline/cmd_parsetree.py
8 issues
Missing module docstring
Error

Line: 1 Column: 1

              # cmdline: -v -v -v
# test printing of the parse-tree

for i in ():
    pass
a = None
b = "str"
c = "a very long str that will not be interned"
d = b"bytes"

            

Reported by Pylint.

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

Line: 6 Column: 1

              
for i in ():
    pass
a = None
b = "str"
c = "a very long str that will not be interned"
d = b"bytes"
e = b"a very long bytes that will not be interned"
f = 123456789012345678901234567890

            

Reported by Pylint.

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

Line: 7 Column: 1

              for i in ():
    pass
a = None
b = "str"
c = "a very long str that will not be interned"
d = b"bytes"
e = b"a very long bytes that will not be interned"
f = 123456789012345678901234567890
g = 123

            

Reported by Pylint.

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

Line: 8 Column: 1

                  pass
a = None
b = "str"
c = "a very long str that will not be interned"
d = b"bytes"
e = b"a very long bytes that will not be interned"
f = 123456789012345678901234567890
g = 123
h = f"fstring: '{b}'"

            

Reported by Pylint.

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

Line: 9 Column: 1

              a = None
b = "str"
c = "a very long str that will not be interned"
d = b"bytes"
e = b"a very long bytes that will not be interned"
f = 123456789012345678901234567890
g = 123
h = f"fstring: '{b}'"

            

Reported by Pylint.

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

Line: 10 Column: 1

              b = "str"
c = "a very long str that will not be interned"
d = b"bytes"
e = b"a very long bytes that will not be interned"
f = 123456789012345678901234567890
g = 123
h = f"fstring: '{b}'"

            

Reported by Pylint.

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

Line: 11 Column: 1

              c = "a very long str that will not be interned"
d = b"bytes"
e = b"a very long bytes that will not be interned"
f = 123456789012345678901234567890
g = 123
h = f"fstring: '{b}'"

            

Reported by Pylint.

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

Line: 12 Column: 1

              d = b"bytes"
e = b"a very long bytes that will not be interned"
f = 123456789012345678901234567890
g = 123
h = f"fstring: '{b}'"

            

Reported by Pylint.

ports/nrf/modules/scripts/_mkfs.py
8 issues
Unable to import 'uos'
Error

Line: 1 Column: 1

              import uos, nrf

try:
    from uos import VfsLfs1

    uos.VfsLfs1.mkfs(nrf.Flash())
except ImportError:
    try:
        from uos import VfsLfs2

            

Reported by Pylint.

Unable to import 'nrf'
Error

Line: 1 Column: 1

              import uos, nrf

try:
    from uos import VfsLfs1

    uos.VfsLfs1.mkfs(nrf.Flash())
except ImportError:
    try:
        from uos import VfsLfs2

            

Reported by Pylint.

Unused VfsLfs1 imported from uos
Error

Line: 4 Column: 5

              import uos, nrf

try:
    from uos import VfsLfs1

    uos.VfsLfs1.mkfs(nrf.Flash())
except ImportError:
    try:
        from uos import VfsLfs2

            

Reported by Pylint.

Unused VfsLfs2 imported from uos
Error

Line: 9 Column: 9

                  uos.VfsLfs1.mkfs(nrf.Flash())
except ImportError:
    try:
        from uos import VfsLfs2

        uos.VfsLfs2.mkfs(nrf.Flash())
    except ImportError:
        try:
            from uos import VfsFat

            

Reported by Pylint.

Unused VfsFat imported from uos
Error

Line: 14 Column: 13

                      uos.VfsLfs2.mkfs(nrf.Flash())
    except ImportError:
        try:
            from uos import VfsFat

            uos.VfsFat.mkfs(nrf.Flash())
        except ImportError:
            pass
        except OSError as e:

            

Reported by Pylint.

Multiple imports on one line (uos, nrf)
Error

Line: 1 Column: 1

              import uos, nrf

try:
    from uos import VfsLfs1

    uos.VfsLfs1.mkfs(nrf.Flash())
except ImportError:
    try:
        from uos import VfsLfs2

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import uos, nrf

try:
    from uos import VfsLfs1

    uos.VfsLfs1.mkfs(nrf.Flash())
except ImportError:
    try:
        from uos import VfsLfs2

            

Reported by Pylint.

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

Line: 19 Column: 9

                          uos.VfsFat.mkfs(nrf.Flash())
        except ImportError:
            pass
        except OSError as e:
            if e.args[0] == 5:  # I/O Error
                flashbdev_size = (nrf.Flash.ioctl(4, 0) * nrf.Flash.ioctl(5, 0)) // 1024
                print()
                print("Is `FS_SIZE=%iK` enough for FAT filesystem?" % flashbdev_size)

            

Reported by Pylint.

tests/float/float_divmod.py
8 issues
Redefining name 'x' from outer scope (line 24)
Error

Line: 5 Column: 10

              # it has some tricky corner cases


def test(x, y):
    div, mod = divmod(x, y)
    print("%.8f %.8f %.8f %.8f" % (x // y, x % y, div, mod))
    print(div == x // y, mod == x % y, abs(div * y + mod - x) < 1e-15)



            

Reported by Pylint.

Redefining name 'y' from outer scope (line 26)
Error

Line: 5 Column: 13

              # it has some tricky corner cases


def test(x, y):
    div, mod = divmod(x, y)
    print("%.8f %.8f %.8f %.8f" % (x // y, x % y, div, mod))
    print(div == x // y, mod == x % y, abs(div * y + mod - x) < 1e-15)



            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test floating point floor divide and modulus
# it has some tricky corner cases


def test(x, y):
    div, mod = divmod(x, y)
    print("%.8f %.8f %.8f %.8f" % (x // y, x % y, div, mod))
    print(div == x // y, mod == x % y, abs(div * y + mod - x) < 1e-15)


            

Reported by Pylint.

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

Line: 5 Column: 1

              # it has some tricky corner cases


def test(x, y):
    div, mod = divmod(x, y)
    print("%.8f %.8f %.8f %.8f" % (x // y, x % y, div, mod))
    print(div == x // y, mod == x % y, abs(div * y + mod - x) < 1e-15)



            

Reported by Pylint.

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

Line: 5 Column: 1

              # it has some tricky corner cases


def test(x, y):
    div, mod = divmod(x, y)
    print("%.8f %.8f %.8f %.8f" % (x // y, x % y, div, mod))
    print(div == x // y, mod == x % y, abs(div * y + mod - x) < 1e-15)



            

Reported by Pylint.

Missing function or method docstring
Error

Line: 5 Column: 1

              # it has some tricky corner cases


def test(x, y):
    div, mod = divmod(x, y)
    print("%.8f %.8f %.8f %.8f" % (x // y, x % y, div, mod))
    print(div == x // y, mod == x % y, abs(div * y + mod - x) < 1e-15)



            

Reported by Pylint.

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

Line: 16 Column: 1

              test(1.23456, -0.7)
test(-1.23456, -0.7)

a = 1.23456
b = 0.7
test(a, b)
test(a, -b)
test(-a, b)
test(-a, -b)

            

Reported by Pylint.

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

Line: 17 Column: 1

              test(-1.23456, -0.7)

a = 1.23456
b = 0.7
test(a, b)
test(a, -b)
test(-a, b)
test(-a, -b)


            

Reported by Pylint.

tests/basics/try_return.py
8 issues
function already defined line 3
Error

Line: 12 Column: 1

                  print(3)
f()

def f(l, i):
    try:
        return l[i]
    except IndexError:
        print('IndexError')
        return -1

            

Reported by Pylint.

No exception type(s) specified
Error

Line: 7 Column: 5

                  try:
        print(1)
        return
    except:
        print(2)
    print(3)
f()

def f(l, i):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test use of return with try-except

def f():
    try:
        print(1)
        return
    except:
        print(2)
    print(3)

            

Reported by Pylint.

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

Line: 3 Column: 1

              # test use of return with try-except

def f():
    try:
        print(1)
        return
    except:
        print(2)
    print(3)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 3 Column: 1

              # test use of return with try-except

def f():
    try:
        print(1)
        return
    except:
        print(2)
    print(3)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 12 Column: 1

                  print(3)
f()

def f(l, i):
    try:
        return l[i]
    except IndexError:
        print('IndexError')
        return -1

            

Reported by Pylint.

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

Line: 12 Column: 1

                  print(3)
f()

def f(l, i):
    try:
        return l[i]
    except IndexError:
        print('IndexError')
        return -1

            

Reported by Pylint.

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

Line: 12 Column: 1

                  print(3)
f()

def f(l, i):
    try:
        return l[i]
    except IndexError:
        print('IndexError')
        return -1

            

Reported by Pylint.

tests/float/float_divmod_relaxed.py
8 issues
Redefining name 'x' from outer scope (line 26)
Error

Line: 8 Column: 10

              # correct) answers for certain combinations of divmod arguments.


def test(x, y):
    div, mod = divmod(x, y)
    print(div == x // y, mod == x % y, abs(div * y + mod - x) < 1e-6)


test(1.23456, 0.7)

            

Reported by Pylint.

Redefining name 'y' from outer scope (line 28)
Error

Line: 8 Column: 13

              # correct) answers for certain combinations of divmod arguments.


def test(x, y):
    div, mod = divmod(x, y)
    print(div == x // y, mod == x % y, abs(div * y + mod - x) < 1e-6)


test(1.23456, 0.7)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test floating point floor divide and modulus
# it has some tricky corner cases

# pyboard has 32-bit floating point and gives different (but still
# correct) answers for certain combinations of divmod arguments.


def test(x, y):
    div, mod = divmod(x, y)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 8 Column: 1

              # correct) answers for certain combinations of divmod arguments.


def test(x, y):
    div, mod = divmod(x, y)
    print(div == x // y, mod == x % y, abs(div * y + mod - x) < 1e-6)


test(1.23456, 0.7)

            

Reported by Pylint.

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

Line: 8 Column: 1

              # correct) answers for certain combinations of divmod arguments.


def test(x, y):
    div, mod = divmod(x, y)
    print(div == x // y, mod == x % y, abs(div * y + mod - x) < 1e-6)


test(1.23456, 0.7)

            

Reported by Pylint.

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

Line: 8 Column: 1

              # correct) answers for certain combinations of divmod arguments.


def test(x, y):
    div, mod = divmod(x, y)
    print(div == x // y, mod == x % y, abs(div * y + mod - x) < 1e-6)


test(1.23456, 0.7)

            

Reported by Pylint.

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

Line: 18 Column: 1

              test(1.23456, -0.7)
test(-1.23456, -0.7)

a = 1.23456
b = 0.7
test(a, b)
test(a, -b)
test(-a, b)
test(-a, -b)

            

Reported by Pylint.

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

Line: 19 Column: 1

              test(-1.23456, -0.7)

a = 1.23456
b = 0.7
test(a, b)
test(a, -b)
test(-a, b)
test(-a, -b)


            

Reported by Pylint.

ports/nrf/examples/mountsd.py
8 issues
Unable to import 'machine'
Error

Line: 24 Column: 1

              """

import os
from machine import SPI, Pin
from sdcard import SDCard


def mnt():
    cs = Pin("P22", mode=Pin.OUT)

            

Reported by Pylint.

Unable to import 'sdcard'
Error

Line: 25 Column: 1

              
import os
from machine import SPI, Pin
from sdcard import SDCard


def mnt():
    cs = Pin("P22", mode=Pin.OUT)
    sd = SDCard(SPI(0), cs)

            

Reported by Pylint.

Module 'os' has no 'mount' member
Error

Line: 31 Column: 5

              def mnt():
    cs = Pin("P22", mode=Pin.OUT)
    sd = SDCard(SPI(0), cs)
    os.mount(sd, "/")


def list():
    files = os.listdir()
    print(files)

            

Reported by Pylint.

Redefining built-in 'list'
Error

Line: 34 Column: 1

                  os.mount(sd, "/")


def list():
    files = os.listdir()
    print(files)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 28 Column: 1

              from sdcard import SDCard


def mnt():
    cs = Pin("P22", mode=Pin.OUT)
    sd = SDCard(SPI(0), cs)
    os.mount(sd, "/")



            

Reported by Pylint.

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

Line: 29 Column: 5

              

def mnt():
    cs = Pin("P22", mode=Pin.OUT)
    sd = SDCard(SPI(0), cs)
    os.mount(sd, "/")


def list():

            

Reported by Pylint.

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

Line: 30 Column: 5

              
def mnt():
    cs = Pin("P22", mode=Pin.OUT)
    sd = SDCard(SPI(0), cs)
    os.mount(sd, "/")


def list():
    files = os.listdir()

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 34 Column: 1

                  os.mount(sd, "/")


def list():
    files = os.listdir()
    print(files)

            

Reported by Pylint.

tests/float/float_compare.py
8 issues
Missing module docstring
Error

Line: 1 Column: 1

              # Extended float comparisons


class Foo:
    pass


foo = Foo()


            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 4 Column: 1

              # Extended float comparisons


class Foo:
    pass


foo = Foo()


            

Reported by Pylint.

Missing class docstring
Error

Line: 4 Column: 1

              # Extended float comparisons


class Foo:
    pass


foo = Foo()


            

Reported by Pylint.

Comparison should be foo == 1.0
Error

Line: 11 Column: 7

              foo = Foo()

print(foo == 1.0)
print(1.0 == foo)
print(1.0 == Foo)
print(1.0 == [])
print(1.0 == {})

try:

            

Reported by Pylint.

Comparison should be Foo == 1.0
Error

Line: 12 Column: 7

              
print(foo == 1.0)
print(1.0 == foo)
print(1.0 == Foo)
print(1.0 == [])
print(1.0 == {})

try:
    print(foo < 1.0)

            

Reported by Pylint.

Comparison should be [] == 1.0
Error

Line: 13 Column: 7

              print(foo == 1.0)
print(1.0 == foo)
print(1.0 == Foo)
print(1.0 == [])
print(1.0 == {})

try:
    print(foo < 1.0)
except TypeError:

            

Reported by Pylint.

Comparison should be {} == 1.0
Error

Line: 14 Column: 7

              print(1.0 == foo)
print(1.0 == Foo)
print(1.0 == [])
print(1.0 == {})

try:
    print(foo < 1.0)
except TypeError:
    print("TypeError")

            

Reported by Pylint.

Comparison should be foo > 1.0
Error

Line: 22 Column: 11

                  print("TypeError")

try:
    print(1.0 < foo)
except TypeError:
    print("TypeError")

            

Reported by Pylint.