The following issues were found

tests/internal_bench/funcall-3-funcall-local.py
9 issues
Unused variable 'a'
Error

Line: 16 Column: 9

              def test(num):
    f_ = f
    for i in iter(range(num)):
        a = f_(i)


bench.run(test)

            

Reported by Pylint.

Module name "funcall-3-funcall-local" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              # Function call overhead test
# Perform the same trivial operation as calling function, cached in a
# local variable. This is commonly known optimization for overly dynamic
# languages (the idea is to cut on symbolic look up overhead, as local
# variables are accessed by offset, not by name)
import bench


def f(x):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # Function call overhead test
# Perform the same trivial operation as calling function, cached in a
# local variable. This is commonly known optimization for overly dynamic
# languages (the idea is to cut on symbolic look up overhead, as local
# variables are accessed by offset, not by name)
import bench


def f(x):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 9 Column: 1

              import bench


def f(x):
    return x + 1


def test(num):
    f_ = f

            

Reported by Pylint.

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

Line: 9 Column: 1

              import bench


def f(x):
    return x + 1


def test(num):
    f_ = f

            

Reported by Pylint.

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

Line: 9 Column: 1

              import bench


def f(x):
    return x + 1


def test(num):
    f_ = f

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 13 Column: 1

                  return x + 1


def test(num):
    f_ = f
    for i in iter(range(num)):
        a = f_(i)



            

Reported by Pylint.

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

Line: 14 Column: 5

              

def test(num):
    f_ = f
    for i in iter(range(num)):
        a = f_(i)


bench.run(test)

            

Reported by Pylint.

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

Line: 16 Column: 9

              def test(num):
    f_ = f
    for i in iter(range(num)):
        a = f_(i)


bench.run(test)

            

Reported by Pylint.

tests/basics/unboundlocal.py
9 issues
Using variable 'x' before assignment
Error

Line: 4 Column: 11

              # locals referenced before assignment

def f1():
    print(x)
    x = 1

def f2():
    for i in range(0):
        print(i)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # locals referenced before assignment

def f1():
    print(x)
    x = 1

def f2():
    for i in range(0):
        print(i)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 3 Column: 1

              # locals referenced before assignment

def f1():
    print(x)
    x = 1

def f2():
    for i in range(0):
        print(i)

            

Reported by Pylint.

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

Line: 3 Column: 1

              # locals referenced before assignment

def f1():
    print(x)
    x = 1

def f2():
    for i in range(0):
        print(i)

            

Reported by Pylint.

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

Line: 5 Column: 5

              
def f1():
    print(x)
    x = 1

def f2():
    for i in range(0):
        print(i)
    print(i)

            

Reported by Pylint.

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

Line: 7 Column: 1

                  print(x)
    x = 1

def f2():
    for i in range(0):
        print(i)
    print(i)

def check(f):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 7 Column: 1

                  print(x)
    x = 1

def f2():
    for i in range(0):
        print(i)
    print(i)

def check(f):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 12 Column: 1

                      print(i)
    print(i)

def check(f):
    try:
        f()
    except NameError:
        print("NameError")


            

Reported by Pylint.

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

Line: 12 Column: 1

                      print(i)
    print(i)

def check(f):
    try:
        f()
    except NameError:
        print("NameError")


            

Reported by Pylint.

ports/esp32/boards/manifest.py
9 issues
Undefined variable 'freeze'
Error

Line: 1 Column: 1

              freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/tools", ("upip.py", "upip_utarfile.py"))
freeze("$(MPY_DIR)/ports/esp8266/modules", "ntptime.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 2 Column: 1

              freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/tools", ("upip.py", "upip_utarfile.py"))
freeze("$(MPY_DIR)/ports/esp8266/modules", "ntptime.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 3 Column: 1

              freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/tools", ("upip.py", "upip_utarfile.py"))
freeze("$(MPY_DIR)/ports/esp8266/modules", "ntptime.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 4 Column: 1

              freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/tools", ("upip.py", "upip_utarfile.py"))
freeze("$(MPY_DIR)/ports/esp8266/modules", "ntptime.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 5 Column: 1

              freeze("$(MPY_DIR)/tools", ("upip.py", "upip_utarfile.py"))
freeze("$(MPY_DIR)/ports/esp8266/modules", "ntptime.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Undefined variable 'include'
Error

Line: 6 Column: 1

              freeze("$(MPY_DIR)/ports/esp8266/modules", "ntptime.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Undefined variable 'include'
Error

Line: 7 Column: 1

              freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Undefined variable 'include'
Error

Line: 8 Column: 1

              freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/tools", ("upip.py", "upip_utarfile.py"))
freeze("$(MPY_DIR)/ports/esp8266/modules", "ntptime.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

tests/basics/exceptpoly.py
9 issues
Catching too general exception Exception
Error

Line: 3 Column: 8

              try:
    raise ArithmeticError
except Exception:
    print("Caught ArithmeticError via Exception")

try:
    raise ArithmeticError
except ArithmeticError:
    print("Caught ArithmeticError")

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 13 Column: 8

              
try:
    raise AssertionError
except Exception:
    print("Caught AssertionError via Exception")

try:
    raise AssertionError
except AssertionError:

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 23 Column: 8

              
try:
    raise AttributeError
except Exception:
    print("Caught AttributeError via Exception")

try:
    raise AttributeError
except AttributeError:

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 33 Column: 8

              
try:
    raise EOFError
except Exception:
    print("Caught EOFError via Exception")

try:
    raise EOFError
except EOFError:

            

Reported by Pylint.

Catching too general exception BaseException
Error

Line: 43 Column: 8

              
try:
    raise Exception
except BaseException:
    print("Caught Exception via BaseException")

try:
    raise Exception
except Exception:

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 48 Column: 8

              
try:
    raise Exception
except Exception:
    print("Caught Exception")

try:
    raise ImportError
except Exception:

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 53 Column: 8

              
try:
    raise ImportError
except Exception:
    print("Caught ImportError via Exception")

try:
    raise ImportError
except ImportError:

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 93 Column: 8

              
try:
    raise LookupError
except Exception:
    print("Caught LookupError via Exception")

try:
    raise LookupError
except LookupError:

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    raise ArithmeticError
except Exception:
    print("Caught ArithmeticError via Exception")

try:
    raise ArithmeticError
except ArithmeticError:
    print("Caught ArithmeticError")

            

Reported by Pylint.

tests/thread/thread_exc1.py
9 issues
Undefined variable 'n_finished'
Error

Line: 19 Column: 9

                      pass
    with lock:
        global n_finished
        n_finished += 1


lock = _thread.allocate_lock()
n_thread = 4
n_finished = 0

            

Reported by Pylint.

Using the global statement
Error

Line: 18 Column: 9

                  except ValueError:
        pass
    with lock:
        global n_finished
        n_finished += 1


lock = _thread.allocate_lock()
n_thread = 4

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test raising and catching an exception within a thread
#
# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd

import _thread


def foo():
    raise ValueError

            

Reported by Pylint.

Black listed name "foo"
Error

Line: 8 Column: 1

              import _thread


def foo():
    raise ValueError


def thread_entry():
    try:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 8 Column: 1

              import _thread


def foo():
    raise ValueError


def thread_entry():
    try:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 12 Column: 1

                  raise ValueError


def thread_entry():
    try:
        foo()
    except ValueError:
        pass
    with lock:

            

Reported by Pylint.

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

Line: 18 Column: 9

                  except ValueError:
        pass
    with lock:
        global n_finished
        n_finished += 1


lock = _thread.allocate_lock()
n_thread = 4

            

Reported by Pylint.

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

Line: 23 Column: 1

              

lock = _thread.allocate_lock()
n_thread = 4
n_finished = 0

# spawn threads
for i in range(n_thread):
    while True:

            

Reported by Pylint.

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

Line: 24 Column: 1

              
lock = _thread.allocate_lock()
n_thread = 4
n_finished = 0

# spawn threads
for i in range(n_thread):
    while True:
        try:

            

Reported by Pylint.

tests/perf_bench/viper_call1a.py
9 issues
Undefined variable 'micropython'
Error

Line: 1 Column: 2

              @micropython.viper
def f1a(x):
    return x


@micropython.native
def call(r):
    f = f1a
    for _ in r:

            

Reported by Pylint.

Undefined variable 'micropython'
Error

Line: 6 Column: 2

                  return x


@micropython.native
def call(r):
    f = f1a
    for _ in r:
        f(1)


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              @micropython.viper
def f1a(x):
    return x


@micropython.native
def call(r):
    f = f1a
    for _ in r:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 2 Column: 1

              @micropython.viper
def f1a(x):
    return x


@micropython.native
def call(r):
    f = f1a
    for _ in r:

            

Reported by Pylint.

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

Line: 2 Column: 1

              @micropython.viper
def f1a(x):
    return x


@micropython.native
def call(r):
    f = f1a
    for _ in r:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 7 Column: 1

              

@micropython.native
def call(r):
    f = f1a
    for _ in r:
        f(1)



            

Reported by Pylint.

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

Line: 7 Column: 1

              

@micropython.native
def call(r):
    f = f1a
    for _ in r:
        f(1)



            

Reported by Pylint.

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

Line: 8 Column: 5

              
@micropython.native
def call(r):
    f = f1a
    for _ in r:
        f(1)


bm_params = {

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 21 Column: 1

              }


def bm_setup(params):
    return lambda: call(range(params[0])), lambda: (params[0] // 1000, None)

            

Reported by Pylint.

tests/extmod/uzlib_decompio_gz.py
9 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 6 Column: 5

                  import uio as io
except ImportError:
    print("SKIP")
    raise SystemExit


# gzip bitstream
buf = io.BytesIO(
    b"\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00"

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    import uzlib as zlib
    import uio as io
except ImportError:
    print("SKIP")
    raise SystemExit


# gzip bitstream

            

Reported by Pylint.

Line too long (107/100)
Error

Line: 11 Column: 1

              
# gzip bitstream
buf = io.BytesIO(
    b"\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00"
)
inp = zlib.DecompIO(buf, 16 + 8)
print(buf.seek(0, 1))
print(inp.read(1))
print(buf.seek(0, 1))

            

Reported by Pylint.

Line too long (106/100)
Error

Line: 26 Column: 1

              
# Check FHCRC field
buf = io.BytesIO(
    b"\x1f\x8b\x08\x02\x99\x0c\xe5W\x00\x03\x00\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00"
)
inp = zlib.DecompIO(buf, 16 + 8)
print(inp.read())

# Check FEXTRA field

            

Reported by Pylint.

Line too long (107/100)
Error

Line: 33 Column: 1

              
# Check FEXTRA field
buf = io.BytesIO(
    b"\x1f\x8b\x08\x04\x99\x0c\xe5W\x00\x03\x01\x00X\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00"
)
inp = zlib.DecompIO(buf, 16 + 8)
print(inp.read())

# broken header

            

Reported by Pylint.

Line too long (107/100)
Error

Line: 40 Column: 1

              
# broken header
buf = io.BytesIO(
    b"\x1f\x8c\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00"
)
try:
    inp = zlib.DecompIO(buf, 16 + 8)
except ValueError:
    print("ValueError")

            

Reported by Pylint.

Line too long (107/100)
Error

Line: 49 Column: 1

              
# broken crc32
buf = io.BytesIO(
    b"\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa7\x106\x05\x00\x00\x00"
)
inp = zlib.DecompIO(buf, 16 + 8)
try:
    inp.read(6)
except OSError as e:

            

Reported by Pylint.

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

Line: 54 Column: 1

              inp = zlib.DecompIO(buf, 16 + 8)
try:
    inp.read(6)
except OSError as e:
    print(repr(e))

# broken uncompressed size - not checked so far
# buf = io.BytesIO(b'\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x06\x00\x00\x00')
# inp = zlib.DecompIO(buf, 16 + 8)

            

Reported by Pylint.

Line too long (123/100)
Error

Line: 58 Column: 1

                  print(repr(e))

# broken uncompressed size - not checked so far
# buf = io.BytesIO(b'\x1f\x8b\x08\x08\x99\x0c\xe5W\x00\x03hello\x00\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x06\x00\x00\x00')
# inp = zlib.DecompIO(buf, 16 + 8)
# inp.read(6)

            

Reported by Pylint.

tests/basics/del_attr.py
9 issues
Method has no argument
Error

Line: 2 Column: 5

              class C:
    def f():
        pass

# del a class attribute

del C.f
try:
    print(C.x)

            

Reported by Pylint.

Attribute 'x' defined outside __init__
Error

Line: 21 Column: 1

              
c = C()

c.x = 1
print(c.x)

del c.x
try:
    print(c.x)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              class C:
    def f():
        pass

# del a class attribute

del C.f
try:
    print(C.x)

            

Reported by Pylint.

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

Line: 1 Column: 1

              class C:
    def f():
        pass

# del a class attribute

del C.f
try:
    print(C.x)

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 1 Column: 1

              class C:
    def f():
        pass

# del a class attribute

del C.f
try:
    print(C.x)

            

Reported by Pylint.

Missing class docstring
Error

Line: 1 Column: 1

              class C:
    def f():
        pass

# del a class attribute

del C.f
try:
    print(C.x)

            

Reported by Pylint.

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

Line: 2 Column: 5

              class C:
    def f():
        pass

# del a class attribute

del C.f
try:
    print(C.x)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 2 Column: 5

              class C:
    def f():
        pass

# del a class attribute

del C.f
try:
    print(C.x)

            

Reported by Pylint.

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

Line: 21 Column: 1

              
c = C()

c.x = 1
print(c.x)

del c.x
try:
    print(c.x)

            

Reported by Pylint.

tests/basics/closure2.py
9 issues
Redefining name 'x' from outer scope (line 11)
Error

Line: 3 Column: 7

              # closures; closing over an argument

def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 4 Column: 5

              # closures; closing over an argument

def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # closures; closing over an argument

def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 3 Column: 1

              # closures; closing over an argument

def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 3 Column: 1

              # closures; closing over an argument

def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 3 Column: 1

              # closures; closing over an argument

def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 4 Column: 5

              # closures; closing over an argument

def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 5 Column: 5

              
def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))


            

Reported by Pylint.

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

Line: 5 Column: 5

              
def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))


            

Reported by Pylint.

tests/basics/closure1.py
9 issues
Redefining name 'x' from outer scope (line 11)
Error

Line: 3 Column: 7

              # closures

def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 4 Column: 5

              # closures

def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # closures

def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 3 Column: 1

              # closures

def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 3 Column: 1

              # closures

def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 3 Column: 1

              # closures

def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 4 Column: 5

              # closures

def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 5 Column: 5

              
def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))


            

Reported by Pylint.

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

Line: 5 Column: 5

              
def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))


            

Reported by Pylint.