The following issues were found

tests/basics/string_format_error.py
10 issues
Not enough arguments for format string
Error

Line: 62 Column: 5

                  print('ValueError')

try:
    '{}{}'.format(1)
except IndexError:
    print('IndexError')

try:
    '{0:+s}'.format('1')

            

Reported by Pylint.

Invalid format string
Error

Line: 14 Column: 5

                  print('IndexError')

try:
    '}'.format('zzzz')
except ValueError:
    print('ValueError')

# end of format parsing conversion specifier
try:

            

Reported by Pylint.

Invalid format string
Error

Line: 20 Column: 5

              
# end of format parsing conversion specifier
try:
    '{!'.format('a')
except ValueError:
    print('ValueError')

# unknown conversion specifier
try:

            

Reported by Pylint.

Invalid format string
Error

Line: 31 Column: 5

                  print('ValueError')

try:
    '{abc'.format('zzzz')
except ValueError:
    print('ValueError')

# expected ':' after specifier
try:

            

Reported by Pylint.

Invalid format string
Error

Line: 37 Column: 5

              
# expected ':' after specifier
try:
    '{!s :}'.format(2)
except ValueError:
    print('ValueError')

try:
    '{}{0}'.format(1, 2)

            

Reported by Pylint.

Format string contains both automatic field numbering and manual field specification
Error

Line: 42 Column: 5

                  print('ValueError')

try:
    '{}{0}'.format(1, 2)
except ValueError:
    print('ValueError')

try:
    '{1:}'.format(1)

            

Reported by Pylint.

Missing keyword argument ' 0 ' for format string
Error

Line: 52 Column: 5

                  print('IndexError')

try:
    '{ 0 :*^10}'.format(12)
except KeyError:
    print('KeyError')

try:
    '{0}{}'.format(1)

            

Reported by Pylint.

Format string contains both automatic field numbering and manual field specification
Error

Line: 57 Column: 5

                  print('KeyError')

try:
    '{0}{}'.format(1)
except ValueError:
    print('ValueError')

try:
    '{}{}'.format(1)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # tests for errors in {} format string

try:
    '{0:0}'.format('zzz')
except (ValueError):
    print('ValueError')

try:
    '{1:}'.format(1)

            

Reported by Pylint.

Unnecessary parens after 'except' keyword
Error

Line: 5 Column: 1

              
try:
    '{0:0}'.format('zzz')
except (ValueError):
    print('ValueError')

try:
    '{1:}'.format(1)
except IndexError:

            

Reported by Pylint.

tests/unix/ffi_callback.py
10 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 5 Column: 5

                  import ffi
except ImportError:
    print("SKIP")
    raise SystemExit


def ffi_open(names):
    err = None
    for n in names:

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    import ffi
except ImportError:
    print("SKIP")
    raise SystemExit


def ffi_open(names):
    err = None

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 8 Column: 1

                  raise SystemExit


def ffi_open(names):
    err = None
    for n in names:
        try:
            mod = ffi.open(n)
            return mod

            

Reported by Pylint.

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

Line: 10 Column: 9

              
def ffi_open(names):
    err = None
    for n in names:
        try:
            mod = ffi.open(n)
            return mod
        except OSError as e:
            err = e

            

Reported by Pylint.

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

Line: 14 Column: 9

                      try:
            mod = ffi.open(n)
            return mod
        except OSError as e:
            err = e
    raise err


libc = ffi_open(("libc.so", "libc.so.0", "libc.so.6", "libc.dylib"))

            

Reported by Pylint.

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

Line: 24 Column: 1

              qsort = libc.func("v", "qsort", "piip")


def cmp(pa, pb):
    a = ffi.as_bytearray(pa, 1)
    b = ffi.as_bytearray(pb, 1)
    # print("cmp:", a, b)
    return a[0] - b[0]


            

Reported by Pylint.

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

Line: 24 Column: 1

              qsort = libc.func("v", "qsort", "piip")


def cmp(pa, pb):
    a = ffi.as_bytearray(pa, 1)
    b = ffi.as_bytearray(pb, 1)
    # print("cmp:", a, b)
    return a[0] - b[0]


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 24 Column: 1

              qsort = libc.func("v", "qsort", "piip")


def cmp(pa, pb):
    a = ffi.as_bytearray(pa, 1)
    b = ffi.as_bytearray(pb, 1)
    # print("cmp:", a, b)
    return a[0] - b[0]


            

Reported by Pylint.

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

Line: 25 Column: 5

              

def cmp(pa, pb):
    a = ffi.as_bytearray(pa, 1)
    b = ffi.as_bytearray(pb, 1)
    # print("cmp:", a, b)
    return a[0] - b[0]



            

Reported by Pylint.

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

Line: 26 Column: 5

              
def cmp(pa, pb):
    a = ffi.as_bytearray(pa, 1)
    b = ffi.as_bytearray(pb, 1)
    # print("cmp:", a, b)
    return a[0] - b[0]


cmp_c = ffi.callback("i", cmp, "pp")

            

Reported by Pylint.

tests/thread/thread_lock4.py
10 issues
Redefining name 'i' from outer scope (line 41)
Error

Line: 14 Column: 9

              
def fac(n):
    x = 1
    for i in range(1, n + 1):
        x *= i
    return x


def thread_entry():

            

Reported by Pylint.

Redefining name 'arg' from outer scope (line 53)
Error

Line: 23 Column: 20

                  while True:
        with jobs_lock:
            try:
                f, arg = jobs.pop(0)
            except IndexError:
                return
        ans = f(arg)
        with output_lock:
            output.append((arg, ans))

            

Reported by Pylint.

Redefining name 'ans' from outer scope (line 53)
Error

Line: 26 Column: 9

                              f, arg = jobs.pop(0)
            except IndexError:
                return
        ans = f(arg)
        with output_lock:
            output.append((arg, ans))


# create a list of jobs

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test using lock to coordinate access to global mutable objects
#
# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd

try:
    import utime as time
except ImportError:
    import time
import _thread

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 12 Column: 1

              import _thread


def fac(n):
    x = 1
    for i in range(1, n + 1):
        x *= i
    return x


            

Reported by Pylint.

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

Line: 12 Column: 1

              import _thread


def fac(n):
    x = 1
    for i in range(1, n + 1):
        x *= i
    return x


            

Reported by Pylint.

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

Line: 13 Column: 5

              

def fac(n):
    x = 1
    for i in range(1, n + 1):
        x *= i
    return x



            

Reported by Pylint.

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

Line: 15 Column: 9

              def fac(n):
    x = 1
    for i in range(1, n + 1):
        x *= i
    return x


def thread_entry():
    while True:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 19 Column: 1

                  return x


def thread_entry():
    while True:
        with jobs_lock:
            try:
                f, arg = jobs.pop(0)
            except IndexError:

            

Reported by Pylint.

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

Line: 23 Column: 17

                  while True:
        with jobs_lock:
            try:
                f, arg = jobs.pop(0)
            except IndexError:
                return
        ans = f(arg)
        with output_lock:
            output.append((arg, ans))

            

Reported by Pylint.

tests/basics/class_inplace_op.py
10 issues
Missing module docstring
Error

Line: 1 Column: 1

              # Case 1: Immutable object (e.g. number-like)
# __iadd__ should not be defined, will be emulated using __add__

class A:

    def __init__(self, v):
        self.v = v

    def __add__(self, o):

            

Reported by Pylint.

Missing class docstring
Error

Line: 4 Column: 1

              # Case 1: Immutable object (e.g. number-like)
# __iadd__ should not be defined, will be emulated using __add__

class A:

    def __init__(self, v):
        self.v = v

    def __add__(self, o):

            

Reported by Pylint.

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

Line: 4 Column: 1

              # Case 1: Immutable object (e.g. number-like)
# __iadd__ should not be defined, will be emulated using __add__

class A:

    def __init__(self, v):
        self.v = v

    def __add__(self, o):

            

Reported by Pylint.

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

Line: 7 Column: 9

              class A:

    def __init__(self, v):
        self.v = v

    def __add__(self, o):
        return A(self.v + o.v)

    def __repr__(self):

            

Reported by Pylint.

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

Line: 9 Column: 5

                  def __init__(self, v):
        self.v = v

    def __add__(self, o):
        return A(self.v + o.v)

    def __repr__(self):
        return "A({})".format(self.v)


            

Reported by Pylint.

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

Line: 25 Column: 1

              # Case 2: Mutable object (e.g. list-like)
# __iadd__ should be defined

class L:

    def __init__(self, v):
        self.v = v

    def __add__(self, o):

            

Reported by Pylint.

Missing class docstring
Error

Line: 25 Column: 1

              # Case 2: Mutable object (e.g. list-like)
# __iadd__ should be defined

class L:

    def __init__(self, v):
        self.v = v

    def __add__(self, o):

            

Reported by Pylint.

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

Line: 28 Column: 9

              class L:

    def __init__(self, v):
        self.v = v

    def __add__(self, o):
        # Should not be caled in this test
        print("L.__add__")
        return L(self.v + o.v)

            

Reported by Pylint.

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

Line: 30 Column: 5

                  def __init__(self, v):
        self.v = v

    def __add__(self, o):
        # Should not be caled in this test
        print("L.__add__")
        return L(self.v + o.v)

    def __iadd__(self, o):

            

Reported by Pylint.

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

Line: 35 Column: 5

                      print("L.__add__")
        return L(self.v + o.v)

    def __iadd__(self, o):
        self.v += o.v
        return self

    def __repr__(self):
        return "L({})".format(self.v)

            

Reported by Pylint.

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

Line: 10 Column: 9

                      import asyncio
    except ImportError:
        print("SKIP")
        raise SystemExit


async def task(i, lock, lock_flag):
    print("task", i, "start")
    try:

            

Reported by Pylint.

Unused variable 't0'
Error

Line: 35 Column: 5

                  lock_flag = [True]

    # Create 4 tasks and let them all run
    t0 = asyncio.create_task(task(0, lock, lock_flag))
    t1 = asyncio.create_task(task(1, lock, lock_flag))
    t2 = asyncio.create_task(task(2, lock, lock_flag))
    t3 = asyncio.create_task(task(3, lock, lock_flag))
    await asyncio.sleep(0)


            

Reported by Pylint.

Unused variable 't3'
Error

Line: 38 Column: 5

                  t0 = asyncio.create_task(task(0, lock, lock_flag))
    t1 = asyncio.create_task(task(1, lock, lock_flag))
    t2 = asyncio.create_task(task(2, lock, lock_flag))
    t3 = asyncio.create_task(task(3, lock, lock_flag))
    await asyncio.sleep(0)

    # Cancel 2 of the tasks (which are waiting on the lock) and release the lock
    t1.cancel()
    t2.cancel()

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # Test that locks work when cancelling multiple waiters on the lock

try:
    import uasyncio as asyncio
except ImportError:
    try:
        import asyncio
    except ImportError:
        print("SKIP")

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 13 Column: 1

                      raise SystemExit


async def task(i, lock, lock_flag):
    print("task", i, "start")
    try:
        await lock.acquire()
    except asyncio.CancelledError:
        print("task", i, "cancel")

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 28 Column: 1

                  print("task", i, "done")


async def main():
    # Create a lock and acquire it so the tasks below must wait
    lock = asyncio.Lock()
    await lock.acquire()
    lock_flag = [True]


            

Reported by Pylint.

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

Line: 35 Column: 5

                  lock_flag = [True]

    # Create 4 tasks and let them all run
    t0 = asyncio.create_task(task(0, lock, lock_flag))
    t1 = asyncio.create_task(task(1, lock, lock_flag))
    t2 = asyncio.create_task(task(2, lock, lock_flag))
    t3 = asyncio.create_task(task(3, lock, lock_flag))
    await asyncio.sleep(0)


            

Reported by Pylint.

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

Line: 36 Column: 5

              
    # Create 4 tasks and let them all run
    t0 = asyncio.create_task(task(0, lock, lock_flag))
    t1 = asyncio.create_task(task(1, lock, lock_flag))
    t2 = asyncio.create_task(task(2, lock, lock_flag))
    t3 = asyncio.create_task(task(3, lock, lock_flag))
    await asyncio.sleep(0)

    # Cancel 2 of the tasks (which are waiting on the lock) and release the lock

            

Reported by Pylint.

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

Line: 37 Column: 5

                  # Create 4 tasks and let them all run
    t0 = asyncio.create_task(task(0, lock, lock_flag))
    t1 = asyncio.create_task(task(1, lock, lock_flag))
    t2 = asyncio.create_task(task(2, lock, lock_flag))
    t3 = asyncio.create_task(task(3, lock, lock_flag))
    await asyncio.sleep(0)

    # Cancel 2 of the tasks (which are waiting on the lock) and release the lock
    t1.cancel()

            

Reported by Pylint.

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

Line: 38 Column: 5

                  t0 = asyncio.create_task(task(0, lock, lock_flag))
    t1 = asyncio.create_task(task(1, lock, lock_flag))
    t2 = asyncio.create_task(task(2, lock, lock_flag))
    t3 = asyncio.create_task(task(3, lock, lock_flag))
    await asyncio.sleep(0)

    # Cancel 2 of the tasks (which are waiting on the lock) and release the lock
    t1.cancel()
    t2.cancel()

            

Reported by Pylint.

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

Line: 25 Column: 5

                  m.__class__
except AttributeError:
    print("SKIP")
    raise SystemExit

r = m.Forward
if 'Descriptor' in repr(r.__class__):
    print('SKIP')
    raise SystemExit

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              class Descriptor:
    def __get__(self, obj, cls):
        print('get')
        print(type(obj) is Main)
        print(cls is Main)
        return 'result'

    def __set__(self, obj, val):
        print('set')

            

Reported by Pylint.

Missing class docstring
Error

Line: 1 Column: 1

              class Descriptor:
    def __get__(self, obj, cls):
        print('get')
        print(type(obj) is Main)
        print(cls is Main)
        return 'result'

    def __set__(self, obj, val):
        print('set')

            

Reported by Pylint.

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

Line: 4 Column: 15

              class Descriptor:
    def __get__(self, obj, cls):
        print('get')
        print(type(obj) is Main)
        print(cls is Main)
        return 'result'

    def __set__(self, obj, val):
        print('set')

            

Reported by Pylint.

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

Line: 10 Column: 15

              
    def __set__(self, obj, val):
        print('set')
        print(type(obj) is Main)
        print(val)

    def __delete__(self, obj):
        print('delete')
        print(type(obj) is Main)

            

Reported by Pylint.

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

Line: 15 Column: 15

              
    def __delete__(self, obj):
        print('delete')
        print(type(obj) is Main)

class Main:
    Forward = Descriptor()

m = Main()

            

Reported by Pylint.

Missing class docstring
Error

Line: 17 Column: 1

                      print('delete')
        print(type(obj) is Main)

class Main:
    Forward = Descriptor()

m = Main()
try:
    m.__class__

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 17 Column: 1

                      print('delete')
        print(type(obj) is Main)

class Main:
    Forward = Descriptor()

m = Main()
try:
    m.__class__

            

Reported by Pylint.

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

Line: 27 Column: 1

                  print("SKIP")
    raise SystemExit

r = m.Forward
if 'Descriptor' in repr(r.__class__):
    print('SKIP')
    raise SystemExit

print(r)

            

Reported by Pylint.

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

Line: 33 Column: 1

                  raise SystemExit

print(r)
m.Forward = 'a'
del m.Forward

            

Reported by Pylint.

tests/basics/class3.py
10 issues
Method has no argument
Error

Line: 4 Column: 5

              # inheritance

class A:
    def a():
        print('A.a() called')

class B(A):
    pass


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # inheritance

class A:
    def a():
        print('A.a() called')

class B(A):
    pass


            

Reported by Pylint.

Missing class docstring
Error

Line: 3 Column: 1

              # inheritance

class A:
    def a():
        print('A.a() called')

class B(A):
    pass


            

Reported by Pylint.

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

Line: 3 Column: 1

              # inheritance

class A:
    def a():
        print('A.a() called')

class B(A):
    pass


            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 3 Column: 1

              # inheritance

class A:
    def a():
        print('A.a() called')

class B(A):
    pass


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 5

              # inheritance

class A:
    def a():
        print('A.a() called')

class B(A):
    pass


            

Reported by Pylint.

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

Line: 4 Column: 5

              # inheritance

class A:
    def a():
        print('A.a() called')

class B(A):
    pass


            

Reported by Pylint.

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

Line: 7 Column: 1

                  def a():
        print('A.a() called')

class B(A):
    pass

print(type(A))
print(type(B))


            

Reported by Pylint.

Missing class docstring
Error

Line: 7 Column: 1

                  def a():
        print('A.a() called')

class B(A):
    pass

print(type(A))
print(type(B))


            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 7 Column: 1

                  def a():
        print('A.a() called')

class B(A):
    pass

print(type(A))
print(type(B))


            

Reported by Pylint.

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

Line: 16 Column: 5

                  print(A().Fun.__name__)
except AttributeError:
    print('SKIP')
    raise SystemExit

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test __name__ on generator functions

def Fun():
    yield

class A:
    def Fun(self):
        yield


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 3 Column: 1

              # test __name__ on generator functions

def Fun():
    yield

class A:
    def Fun(self):
        yield


            

Reported by Pylint.

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

Line: 3 Column: 1

              # test __name__ on generator functions

def Fun():
    yield

class A:
    def Fun(self):
        yield


            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 6 Column: 1

              def Fun():
    yield

class A:
    def Fun(self):
        yield

try:
    print(Fun.__name__)

            

Reported by Pylint.

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

Line: 6 Column: 1

              def Fun():
    yield

class A:
    def Fun(self):
        yield

try:
    print(Fun.__name__)

            

Reported by Pylint.

Missing class docstring
Error

Line: 6 Column: 1

              def Fun():
    yield

class A:
    def Fun(self):
        yield

try:
    print(Fun.__name__)

            

Reported by Pylint.

Method could be a function
Error

Line: 7 Column: 5

                  yield

class A:
    def Fun(self):
        yield

try:
    print(Fun.__name__)
    print(A.Fun.__name__)

            

Reported by Pylint.

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

Line: 7 Column: 5

                  yield

class A:
    def Fun(self):
        yield

try:
    print(Fun.__name__)
    print(A.Fun.__name__)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 7 Column: 5

                  yield

class A:
    def Fun(self):
        yield

try:
    print(Fun.__name__)
    print(A.Fun.__name__)

            

Reported by Pylint.

tests/internal_bench/func_args-1.2-pos_3.py
10 issues
Unused argument 'a'
Error

Line: 4 Column: 10

              import bench


def func(a, b, c):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Unused argument 'c'
Error

Line: 4 Column: 16

              import bench


def func(a, b, c):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Unused argument 'b'
Error

Line: 4 Column: 13

              import bench


def func(a, b, c):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import bench


def func(a, b, c):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Module name "2-pos_3" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              import bench


def func(a, b, c):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

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

Line: 4 Column: 1

              import bench


def func(a, b, c):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

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

Line: 4 Column: 1

              import bench


def func(a, b, c):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

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

Line: 4 Column: 1

              import bench


def func(a, b, c):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              import bench


def func(a, b, c):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 8 Column: 1

                  pass


def test(num):
    for i in iter(range(num)):
        func(i, i, i)


bench.run(test)

            

Reported by Pylint.

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

Line: 12 Column: 5

                  t = A()[1:2]
except:
    print("SKIP")
    raise SystemExit


A()[1:2:3]

# test storing to attr (shouldn't be allowed)

            

Reported by Pylint.

Expression "A()[1:2:3]" is assigned to nothing
Error

Line: 15 Column: 1

                  raise SystemExit


A()[1:2:3]

# test storing to attr (shouldn't be allowed)
class B:
    def __getitem__(self, idx):
        try:

            

Reported by Pylint.

Expression "B()[:]" is assigned to nothing
Error

Line: 24 Column: 1

                          idx.start = 0
        except AttributeError:
            print('AttributeError')
B()[:]

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test builtin slice attributes access

# print slice attributes
class A:
    def __getitem__(self, idx):
        print(idx.start, idx.stop, idx.step)

try:
    t = A()[1:2]

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 4 Column: 1

              # test builtin slice attributes access

# print slice attributes
class A:
    def __getitem__(self, idx):
        print(idx.start, idx.stop, idx.step)

try:
    t = A()[1:2]

            

Reported by Pylint.

Missing class docstring
Error

Line: 4 Column: 1

              # test builtin slice attributes access

# print slice attributes
class A:
    def __getitem__(self, idx):
        print(idx.start, idx.stop, idx.step)

try:
    t = A()[1:2]

            

Reported by Pylint.

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

Line: 4 Column: 1

              # test builtin slice attributes access

# print slice attributes
class A:
    def __getitem__(self, idx):
        print(idx.start, idx.stop, idx.step)

try:
    t = A()[1:2]

            

Reported by Pylint.

Missing class docstring
Error

Line: 18 Column: 1

              A()[1:2:3]

# test storing to attr (shouldn't be allowed)
class B:
    def __getitem__(self, idx):
        try:
            idx.start = 0
        except AttributeError:
            print('AttributeError')

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 18 Column: 1

              A()[1:2:3]

# test storing to attr (shouldn't be allowed)
class B:
    def __getitem__(self, idx):
        try:
            idx.start = 0
        except AttributeError:
            print('AttributeError')

            

Reported by Pylint.

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

Line: 18 Column: 1

              A()[1:2:3]

# test storing to attr (shouldn't be allowed)
class B:
    def __getitem__(self, idx):
        try:
            idx.start = 0
        except AttributeError:
            print('AttributeError')

            

Reported by Pylint.