The following issues were found
tests/internal_bench/var-6-instance-attr.py
7 issues
Line: 9
Column: 10
self.num = 20000000
def test(num):
o = Foo()
i = 0
while i < o.num:
i += 1
Reported by Pylint.
Line: 1
Column: 1
import bench
class Foo:
def __init__(self):
self.num = 20000000
def test(num):
Reported by Pylint.
Line: 1
Column: 1
import bench
class Foo:
def __init__(self):
self.num = 20000000
def test(num):
Reported by Pylint.
Line: 4
Column: 1
import bench
class Foo:
def __init__(self):
self.num = 20000000
def test(num):
Reported by Pylint.
Line: 4
Column: 1
import bench
class Foo:
def __init__(self):
self.num = 20000000
def test(num):
Reported by Pylint.
Line: 9
Column: 1
self.num = 20000000
def test(num):
o = Foo()
i = 0
while i < o.num:
i += 1
Reported by Pylint.
Line: 10
Column: 5
def test(num):
o = Foo()
i = 0
while i < o.num:
i += 1
Reported by Pylint.
tests/basics/subclass_native_containment.py
7 issues
Line: 1
Column: 1
# test containment operator on subclass of a native type
class mylist(list):
pass
class mydict(dict):
pass
class mybytes(bytes):
Reported by Pylint.
Line: 3
Column: 1
# test containment operator on subclass of a native type
class mylist(list):
pass
class mydict(dict):
pass
class mybytes(bytes):
Reported by Pylint.
Line: 3
Column: 1
# test containment operator on subclass of a native type
class mylist(list):
pass
class mydict(dict):
pass
class mybytes(bytes):
Reported by Pylint.
Line: 6
Column: 1
class mylist(list):
pass
class mydict(dict):
pass
class mybytes(bytes):
pass
Reported by Pylint.
Line: 6
Column: 1
class mylist(list):
pass
class mydict(dict):
pass
class mybytes(bytes):
pass
Reported by Pylint.
Line: 9
Column: 1
class mydict(dict):
pass
class mybytes(bytes):
pass
l = mylist([1, 2, 3])
print(0 in l)
print(1 in l)
Reported by Pylint.
Line: 9
Column: 1
class mydict(dict):
pass
class mybytes(bytes):
pass
l = mylist([1, 2, 3])
print(0 in l)
print(1 in l)
Reported by Pylint.
tests/internal_bench/var-6.1-instance-attr-5.py
7 issues
Line: 13
Column: 10
self.num = 20000000
def test(num):
o = Foo()
i = 0
while i < o.num:
i += 1
Reported by Pylint.
Line: 1
Column: 1
import bench
class Foo:
def __init__(self):
self.num1 = 0
self.num2 = 0
self.num3 = 0
self.num4 = 0
Reported by Pylint.
Line: 1
Column: 1
import bench
class Foo:
def __init__(self):
self.num1 = 0
self.num2 = 0
self.num3 = 0
self.num4 = 0
Reported by Pylint.
Line: 4
Column: 1
import bench
class Foo:
def __init__(self):
self.num1 = 0
self.num2 = 0
self.num3 = 0
self.num4 = 0
Reported by Pylint.
Line: 4
Column: 1
import bench
class Foo:
def __init__(self):
self.num1 = 0
self.num2 = 0
self.num3 = 0
self.num4 = 0
Reported by Pylint.
Line: 13
Column: 1
self.num = 20000000
def test(num):
o = Foo()
i = 0
while i < o.num:
i += 1
Reported by Pylint.
Line: 14
Column: 5
def test(num):
o = Foo()
i = 0
while i < o.num:
i += 1
Reported by Pylint.
drivers/neopixel/neopixel.py
7 issues
Line: 4
Column: 1
# NeoPixel driver for MicroPython
# MIT license; Copyright (c) 2016 Damien P. George, 2021 Jim Mussared
from micropython import const
from machine import bitstream
_BITSTREAM_TYPE_HIGH_LOW = const(0)
_TIMING_WS2818_800 = (400, 850, 800, 450)
_TIMING_WS2818_400 = (800, 1700, 1600, 900)
Reported by Pylint.
Line: 5
Column: 1
# MIT license; Copyright (c) 2016 Damien P. George, 2021 Jim Mussared
from micropython import const
from machine import bitstream
_BITSTREAM_TYPE_HIGH_LOW = const(0)
_TIMING_WS2818_800 = (400, 850, 800, 450)
_TIMING_WS2818_400 = (800, 1700, 1600, 900)
Reported by Pylint.
Line: 1
Column: 1
# NeoPixel driver for MicroPython
# MIT license; Copyright (c) 2016 Damien P. George, 2021 Jim Mussared
from micropython import const
from machine import bitstream
_BITSTREAM_TYPE_HIGH_LOW = const(0)
_TIMING_WS2818_800 = (400, 850, 800, 450)
_TIMING_WS2818_400 = (800, 1700, 1600, 900)
Reported by Pylint.
Line: 12
Column: 1
_TIMING_WS2818_400 = (800, 1700, 1600, 900)
class NeoPixel:
ORDER = (1, 0, 2, 3)
def __init__(self, pin, n, bpp=3, timing=1):
self.pin = pin
self.n = n
Reported by Pylint.
Line: 17
Column: 9
def __init__(self, pin, n, bpp=3, timing=1):
self.pin = pin
self.n = n
self.bpp = bpp
self.buf = bytearray(n * bpp)
self.pin.init(pin.OUT)
self.timing = (
(_TIMING_WS2818_800 if timing else _TIMING_WS2818_400)
Reported by Pylint.
Line: 39
Column: 5
offset = index * self.bpp
return tuple(self.buf[offset + self.ORDER[i]] for i in range(self.bpp))
def fill(self, color):
for i in range(self.n):
self[i] = color
def write(self):
bitstream(self.pin, _BITSTREAM_TYPE_HIGH_LOW, self.timing, self.buf)
Reported by Pylint.
Line: 43
Column: 5
for i in range(self.n):
self[i] = color
def write(self):
bitstream(self.pin, _BITSTREAM_TYPE_HIGH_LOW, self.timing, self.buf)
Reported by Pylint.
tests/basics/builtin_reversed.py
7 issues
Line: 6
Column: 5
reversed
except:
print("SKIP")
raise SystemExit
# list
print(list(reversed([])))
print(list(reversed([1])))
print(list(reversed([1, 2, 3])))
Reported by Pylint.
Line: 1
Column: 1
# test the builtin reverse() function
try:
reversed
except:
print("SKIP")
raise SystemExit
# list
print(list(reversed([])))
Reported by Pylint.
Line: 30
Column: 1
print(i)
# user object
class A:
def __init__(self):
pass
def __len__(self):
return 3
def __getitem__(self, pos):
Reported by Pylint.
Line: 30
Column: 1
print(i)
# user object
class A:
def __init__(self):
pass
def __len__(self):
return 3
def __getitem__(self, pos):
Reported by Pylint.
Line: 41
Column: 1
print(a)
# user object with __reversed__
class B:
def __reversed__(self):
return [1, 2, 3]
print(reversed(B()))
Reported by Pylint.
Line: 41
Column: 1
print(a)
# user object with __reversed__
class B:
def __reversed__(self):
return [1, 2, 3]
print(reversed(B()))
Reported by Pylint.
Line: 41
Column: 1
print(a)
# user object with __reversed__
class B:
def __reversed__(self):
return [1, 2, 3]
print(reversed(B()))
Reported by Pylint.
tests/extmod/uasyncio_cancel_self.py
7 issues
Line: 10
Column: 9
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
async def task():
print("task start")
global_task.cancel()
Reported by Pylint.
Line: 19
Column: 5
async def main():
global global_task
global_task = asyncio.create_task(task())
try:
await global_task
except asyncio.CancelledError:
print("main cancel")
Reported by Pylint.
Line: 1
Column: 1
# Test a task cancelling itself (currently unsupported)
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
Reported by Pylint.
Line: 13
Column: 1
raise SystemExit
async def task():
print("task start")
global_task.cancel()
async def main():
Reported by Pylint.
Line: 18
Column: 1
global_task.cancel()
async def main():
global global_task
global_task = asyncio.create_task(task())
try:
await global_task
except asyncio.CancelledError:
Reported by Pylint.
Line: 19
Column: 5
async def main():
global global_task
global_task = asyncio.create_task(task())
try:
await global_task
except asyncio.CancelledError:
print("main cancel")
Reported by Pylint.
Line: 30
Column: 1
try:
asyncio.run(main())
except RuntimeError as er:
print(er)
Reported by Pylint.
tests/extmod/framebuf8.py
7 issues
Line: 5
Column: 5
import framebuf
except ImportError:
print("SKIP")
raise SystemExit
def printbuf():
print("--8<--")
for y in range(h):
Reported by Pylint.
Line: 1
Column: 1
try:
import framebuf
except ImportError:
print("SKIP")
raise SystemExit
def printbuf():
print("--8<--")
Reported by Pylint.
Line: 8
Column: 1
raise SystemExit
def printbuf():
print("--8<--")
for y in range(h):
for x in range(w):
print("%02x" % buf[(x + y * w)], end="")
print()
Reported by Pylint.
Line: 10
Column: 9
def printbuf():
print("--8<--")
for y in range(h):
for x in range(w):
print("%02x" % buf[(x + y * w)], end="")
print()
print("-->8--")
Reported by Pylint.
Line: 11
Column: 13
def printbuf():
print("--8<--")
for y in range(h):
for x in range(w):
print("%02x" % buf[(x + y * w)], end="")
print()
print("-->8--")
Reported by Pylint.
Line: 17
Column: 1
print("-->8--")
w = 8
h = 5
buf = bytearray(w * h)
fbuf = framebuf.FrameBuffer(buf, w, h, framebuf.GS8)
# fill
Reported by Pylint.
Line: 18
Column: 1
w = 8
h = 5
buf = bytearray(w * h)
fbuf = framebuf.FrameBuffer(buf, w, h, framebuf.GS8)
# fill
fbuf.fill(0x55)
Reported by Pylint.
tests/basics/memoryview_gc.py
7 issues
Line: 6
Column: 5
memoryview
except:
print("SKIP")
raise SystemExit
b = bytearray(10)
m = memoryview(b)[1:]
for i in range(len(m)):
m[i] = i
Reported by Pylint.
Line: 20
Column: 5
# allocate lots of memory
for i in range(100000):
[42, 42, 42, 42]
# check that the memoryview is still what we want
print(list(m))
# check that creating a memoryview of a memoryview retains the underlying data
Reported by Pylint.
Line: 1
Column: 1
# test memoryview retains pointer to original object/buffer
try:
memoryview
except:
print("SKIP")
raise SystemExit
b = bytearray(10)
m = memoryview(b)[1:]
Reported by Pylint.
Line: 10
Column: 1
b = bytearray(10)
m = memoryview(b)[1:]
for i in range(len(m)):
m[i] = i
# reclaim b, but hopefully not the buffer
b = None
import gc
Reported by Pylint.
Line: 14
Column: 1
m[i] = i
# reclaim b, but hopefully not the buffer
b = None
import gc
gc.collect()
# allocate lots of memory
for i in range(100000):
Reported by Pylint.
Line: 15
Column: 1
# reclaim b, but hopefully not the buffer
b = None
import gc
gc.collect()
# allocate lots of memory
for i in range(100000):
[42, 42, 42, 42]
Reported by Pylint.
Line: 26
Column: 1
print(list(m))
# check that creating a memoryview of a memoryview retains the underlying data
m = None
gc.collect() # cleanup from previous test
m = memoryview(memoryview(bytearray(i for i in range(50)))[5:-5])
print(sum(m), list(m[:10]))
gc.collect()
for i in range(10):
Reported by Pylint.
tests/internal_bench/from_iter-7-bytearray_bound.py
7 issues
Line: 5
Column: 9
def test(num):
for i in iter(range(num // 10000)):
l = [0] * 1000
l2 = bytearray(l)
bench.run(test)
Reported by Pylint.
Line: 7
Column: 9
def test(num):
for i in iter(range(num // 10000)):
l = [0] * 1000
l2 = bytearray(l)
bench.run(test)
Reported by Pylint.
Line: 1
Column: 1
import bench
def test(num):
for i in iter(range(num // 10000)):
l = [0] * 1000
l2 = bytearray(l)
Reported by Pylint.
Line: 1
Column: 1
import bench
def test(num):
for i in iter(range(num // 10000)):
l = [0] * 1000
l2 = bytearray(l)
Reported by Pylint.
Line: 4
Column: 1
import bench
def test(num):
for i in iter(range(num // 10000)):
l = [0] * 1000
l2 = bytearray(l)
Reported by Pylint.
Line: 6
Column: 9
def test(num):
for i in iter(range(num // 10000)):
l = [0] * 1000
l2 = bytearray(l)
bench.run(test)
Reported by Pylint.
Line: 7
Column: 9
def test(num):
for i in iter(range(num // 10000)):
l = [0] * 1000
l2 = bytearray(l)
bench.run(test)
Reported by Pylint.
tests/internal_bench/from_iter-8-bytearray_unbound.py
7 issues
Line: 5
Column: 9
def test(num):
for i in iter(range(num // 10000)):
l = [0] * 1000
l2 = bytearray(map(lambda x: x, l))
bench.run(test)
Reported by Pylint.
Line: 7
Column: 9
def test(num):
for i in iter(range(num // 10000)):
l = [0] * 1000
l2 = bytearray(map(lambda x: x, l))
bench.run(test)
Reported by Pylint.
Line: 1
Column: 1
import bench
def test(num):
for i in iter(range(num // 10000)):
l = [0] * 1000
l2 = bytearray(map(lambda x: x, l))
Reported by Pylint.
Line: 1
Column: 1
import bench
def test(num):
for i in iter(range(num // 10000)):
l = [0] * 1000
l2 = bytearray(map(lambda x: x, l))
Reported by Pylint.
Line: 4
Column: 1
import bench
def test(num):
for i in iter(range(num // 10000)):
l = [0] * 1000
l2 = bytearray(map(lambda x: x, l))
Reported by Pylint.
Line: 6
Column: 9
def test(num):
for i in iter(range(num // 10000)):
l = [0] * 1000
l2 = bytearray(map(lambda x: x, l))
bench.run(test)
Reported by Pylint.
Line: 7
Column: 9
def test(num):
for i in iter(range(num // 10000)):
l = [0] * 1000
l2 = bytearray(map(lambda x: x, l))
bench.run(test)
Reported by Pylint.