The following issues were found
tests/micropython/viper_subscr.py
9 issues
Line: 4
Column: 2
# test standard Python subscr using viper types
@micropython.viper
def get(dest, i: int):
i += 1
return dest[i]
Reported by Pylint.
Line: 10
Column: 2
return dest[i]
@micropython.viper
def set(dest, i: int, val: int):
i += 1
dest[i] = val + 1
Reported by Pylint.
Line: 5
Column: 15
@micropython.viper
def get(dest, i: int):
i += 1
return dest[i]
@micropython.viper
Reported by Pylint.
Line: 11
Column: 15
@micropython.viper
def set(dest, i: int, val: int):
i += 1
dest[i] = val + 1
ar = [i for i in range(3)]
Reported by Pylint.
Line: 11
Column: 1
@micropython.viper
def set(dest, i: int, val: int):
i += 1
dest[i] = val + 1
ar = [i for i in range(3)]
Reported by Pylint.
Line: 1
Column: 1
# test standard Python subscr using viper types
@micropython.viper
def get(dest, i: int):
i += 1
return dest[i]
Reported by Pylint.
Line: 5
Column: 1
@micropython.viper
def get(dest, i: int):
i += 1
return dest[i]
@micropython.viper
Reported by Pylint.
Line: 11
Column: 1
@micropython.viper
def set(dest, i: int, val: int):
i += 1
dest[i] = val + 1
ar = [i for i in range(3)]
Reported by Pylint.
Line: 16
Column: 1
dest[i] = val + 1
ar = [i for i in range(3)]
for i in range(len(ar)):
set(ar, i - 1, i)
print(ar)
Reported by Pylint.
tests/basics/subclass_native5.py
9 issues
Line: 1
Column: 1
# Subclass from 2 bases explicitly subclasses from object
class Base1(object):
pass
class Base2(object):
pass
class Sub(Base1, Base2):
Reported by Pylint.
Line: 3
Column: 1
# Subclass from 2 bases explicitly subclasses from object
class Base1(object):
pass
class Base2(object):
pass
class Sub(Base1, Base2):
Reported by Pylint.
Line: 3
Column: 1
# Subclass from 2 bases explicitly subclasses from object
class Base1(object):
pass
class Base2(object):
pass
class Sub(Base1, Base2):
Reported by Pylint.
Line: 3
Column: 1
# Subclass from 2 bases explicitly subclasses from object
class Base1(object):
pass
class Base2(object):
pass
class Sub(Base1, Base2):
Reported by Pylint.
Line: 6
Column: 1
class Base1(object):
pass
class Base2(object):
pass
class Sub(Base1, Base2):
pass
Reported by Pylint.
Line: 6
Column: 1
class Base1(object):
pass
class Base2(object):
pass
class Sub(Base1, Base2):
pass
Reported by Pylint.
Line: 6
Column: 1
class Base1(object):
pass
class Base2(object):
pass
class Sub(Base1, Base2):
pass
Reported by Pylint.
Line: 9
Column: 1
class Base2(object):
pass
class Sub(Base1, Base2):
pass
o = Sub()
Reported by Pylint.
Line: 9
Column: 1
class Base2(object):
pass
class Sub(Base1, Base2):
pass
o = Sub()
Reported by Pylint.
examples/hwapi/hwconfig_console.py
9 issues
Line: 4
Column: 24
# This is hwconfig for "emulation" for cases when there's no real hardware.
# It just prints information to console.
class LEDClass:
def __init__(self, id):
self.id = "LED(%d):" % id
def value(self, v):
print(self.id, v)
Reported by Pylint.
Line: 1
Column: 1
# This is hwconfig for "emulation" for cases when there's no real hardware.
# It just prints information to console.
class LEDClass:
def __init__(self, id):
self.id = "LED(%d):" % id
def value(self, v):
print(self.id, v)
Reported by Pylint.
Line: 3
Column: 1
# This is hwconfig for "emulation" for cases when there's no real hardware.
# It just prints information to console.
class LEDClass:
def __init__(self, id):
self.id = "LED(%d):" % id
def value(self, v):
print(self.id, v)
Reported by Pylint.
Line: 5
Column: 9
# It just prints information to console.
class LEDClass:
def __init__(self, id):
self.id = "LED(%d):" % id
def value(self, v):
print(self.id, v)
def on(self):
Reported by Pylint.
Line: 7
Column: 5
def __init__(self, id):
self.id = "LED(%d):" % id
def value(self, v):
print(self.id, v)
def on(self):
self.value(1)
Reported by Pylint.
Line: 7
Column: 5
def __init__(self, id):
self.id = "LED(%d):" % id
def value(self, v):
print(self.id, v)
def on(self):
self.value(1)
Reported by Pylint.
Line: 10
Column: 5
def value(self, v):
print(self.id, v)
def on(self):
self.value(1)
def off(self):
self.value(0)
Reported by Pylint.
Line: 10
Column: 5
def value(self, v):
print(self.id, v)
def on(self):
self.value(1)
def off(self):
self.value(0)
Reported by Pylint.
Line: 13
Column: 5
def on(self):
self.value(1)
def off(self):
self.value(0)
LED = LEDClass(1)
LED2 = LEDClass(12)
Reported by Pylint.
tests/perf_bench/viper_call1b.py
9 issues
Line: 1
Column: 2
@micropython.viper
def f1b(x) -> int:
return int(x)
@micropython.native
def call(r):
f = f1b
for _ in r:
Reported by Pylint.
Line: 6
Column: 2
return int(x)
@micropython.native
def call(r):
f = f1b
for _ in r:
f(1)
Reported by Pylint.
Line: 1
Column: 1
@micropython.viper
def f1b(x) -> int:
return int(x)
@micropython.native
def call(r):
f = f1b
for _ in r:
Reported by Pylint.
Line: 2
Column: 1
@micropython.viper
def f1b(x) -> int:
return int(x)
@micropython.native
def call(r):
f = f1b
for _ in r:
Reported by Pylint.
Line: 2
Column: 1
@micropython.viper
def f1b(x) -> int:
return int(x)
@micropython.native
def call(r):
f = f1b
for _ in r:
Reported by Pylint.
Line: 7
Column: 1
@micropython.native
def call(r):
f = f1b
for _ in r:
f(1)
Reported by Pylint.
Line: 7
Column: 1
@micropython.native
def call(r):
f = f1b
for _ in r:
f(1)
Reported by Pylint.
Line: 8
Column: 5
@micropython.native
def call(r):
f = f1b
for _ in r:
f(1)
bm_params = {
Reported by Pylint.
Line: 21
Column: 1
}
def bm_setup(params):
return lambda: call(range(params[0])), lambda: (params[0] // 1000, None)
Reported by Pylint.
examples/unix/ffi_example.py
9 issues
Line: 1
Column: 1
import ffi
import uctypes
libc = ffi.open("libc.so.6")
print("libc:", libc)
print()
# Declare few functions
perror = libc.func("v", "perror", "s")
Reported by Pylint.
Line: 2
Column: 1
import ffi
import uctypes
libc = ffi.open("libc.so.6")
print("libc:", libc)
print()
# Declare few functions
perror = libc.func("v", "perror", "s")
Reported by Pylint.
Line: 11
Column: 1
# Declare few functions
perror = libc.func("v", "perror", "s")
time = libc.func("i", "time", "p")
open = libc.func("i", "open", "si")
qsort = libc.func("v", "qsort", "piiC")
# And one variable
errno = libc.var("i", "errno")
print("time:", time)
Reported by Pylint.
Line: 1
Column: 1
import ffi
import uctypes
libc = ffi.open("libc.so.6")
print("libc:", libc)
print()
# Declare few functions
perror = libc.func("v", "perror", "s")
Reported by Pylint.
Line: 28
Column: 1
print()
def cmp(pa, pb):
a = uctypes.bytearray_at(pa, 1)
b = uctypes.bytearray_at(pb, 1)
print("cmp:", a, b)
return a[0] - b[0]
Reported by Pylint.
Line: 28
Column: 1
print()
def cmp(pa, pb):
a = uctypes.bytearray_at(pa, 1)
b = uctypes.bytearray_at(pb, 1)
print("cmp:", a, b)
return a[0] - b[0]
Reported by Pylint.
Line: 28
Column: 1
print()
def cmp(pa, pb):
a = uctypes.bytearray_at(pa, 1)
b = uctypes.bytearray_at(pb, 1)
print("cmp:", a, b)
return a[0] - b[0]
Reported by Pylint.
Line: 29
Column: 5
def cmp(pa, pb):
a = uctypes.bytearray_at(pa, 1)
b = uctypes.bytearray_at(pb, 1)
print("cmp:", a, b)
return a[0] - b[0]
Reported by Pylint.
Line: 30
Column: 5
def cmp(pa, pb):
a = uctypes.bytearray_at(pa, 1)
b = uctypes.bytearray_at(pb, 1)
print("cmp:", a, b)
return a[0] - b[0]
cmp_cb = ffi.callback("i", cmp, "PP")
Reported by Pylint.
examples/rp2/pwm_fade.py
8 issues
Line: 4
Column: 1
# Example using PWM to fade an LED.
import time
from machine import Pin, PWM
# Construct PWM object, with LED on Pin(25).
pwm = PWM(Pin(25))
Reported by Pylint.
Line: 1
Column: 1
# Example using PWM to fade an LED.
import time
from machine import Pin, PWM
# Construct PWM object, with LED on Pin(25).
pwm = PWM(Pin(25))
Reported by Pylint.
Line: 14
Column: 1
pwm.freq(1000)
# Fade the LED in and out a few times.
duty = 0
direction = 1
for _ in range(8 * 256):
duty += direction
if duty > 255:
duty = 255
Reported by Pylint.
Line: 15
Column: 1
# Fade the LED in and out a few times.
duty = 0
direction = 1
for _ in range(8 * 256):
duty += direction
if duty > 255:
duty = 255
direction = -1
Reported by Pylint.
Line: 19
Column: 9
for _ in range(8 * 256):
duty += direction
if duty > 255:
duty = 255
direction = -1
elif duty < 0:
duty = 0
direction = 1
pwm.duty_u16(duty * duty)
Reported by Pylint.
Line: 20
Column: 9
duty += direction
if duty > 255:
duty = 255
direction = -1
elif duty < 0:
duty = 0
direction = 1
pwm.duty_u16(duty * duty)
time.sleep(0.001)
Reported by Pylint.
Line: 22
Column: 9
duty = 255
direction = -1
elif duty < 0:
duty = 0
direction = 1
pwm.duty_u16(duty * duty)
time.sleep(0.001)
Reported by Pylint.
Line: 23
Column: 9
direction = -1
elif duty < 0:
duty = 0
direction = 1
pwm.duty_u16(duty * duty)
time.sleep(0.001)
Reported by Pylint.
tests/basics/builtin_delattr.py
8 issues
Line: 6
Column: 5
delattr
except:
print("SKIP")
raise SystemExit
class A: pass
a = A()
a.x = 1
print(a.x)
Reported by Pylint.
Line: 10
Column: 1
class A: pass
a = A()
a.x = 1
print(a.x)
delattr(a, 'x')
try:
Reported by Pylint.
Line: 1
Column: 1
# test builtin delattr
try:
delattr
except:
print("SKIP")
raise SystemExit
class A: pass
a = A()
Reported by Pylint.
Line: 8
Column: 10
print("SKIP")
raise SystemExit
class A: pass
a = A()
a.x = 1
print(a.x)
delattr(a, 'x')
Reported by Pylint.
Line: 8
Column: 1
print("SKIP")
raise SystemExit
class A: pass
a = A()
a.x = 1
print(a.x)
delattr(a, 'x')
Reported by Pylint.
Line: 8
Column: 1
print("SKIP")
raise SystemExit
class A: pass
a = A()
a.x = 1
print(a.x)
delattr(a, 'x')
Reported by Pylint.
Line: 8
Column: 1
print("SKIP")
raise SystemExit
class A: pass
a = A()
a.x = 1
print(a.x)
delattr(a, 'x')
Reported by Pylint.
Line: 10
Column: 1
class A: pass
a = A()
a.x = 1
print(a.x)
delattr(a, 'x')
try:
Reported by Pylint.
ports/esp8266/modules/_boot.py
8 issues
Line: 3
Column: 1
import gc
gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4)
import uos
from flashbdev import bdev
if bdev:
try:
uos.mount(bdev, "/")
Reported by Pylint.
Line: 3
Column: 15
import gc
gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4)
import uos
from flashbdev import bdev
if bdev:
try:
uos.mount(bdev, "/")
Reported by Pylint.
Line: 3
Column: 31
import gc
gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4)
import uos
from flashbdev import bdev
if bdev:
try:
uos.mount(bdev, "/")
Reported by Pylint.
Line: 4
Column: 1
import gc
gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4)
import uos
from flashbdev import bdev
if bdev:
try:
uos.mount(bdev, "/")
Reported by Pylint.
Line: 10
Column: 5
if bdev:
try:
uos.mount(bdev, "/")
except:
import inisetup
inisetup.setup()
gc.collect()
Reported by Pylint.
Line: 1
Column: 1
import gc
gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4)
import uos
from flashbdev import bdev
if bdev:
try:
uos.mount(bdev, "/")
Reported by Pylint.
Line: 4
Column: 1
import gc
gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4)
import uos
from flashbdev import bdev
if bdev:
try:
uos.mount(bdev, "/")
Reported by Pylint.
Line: 5
Column: 1
gc.threshold((gc.mem_free() + gc.mem_alloc()) // 4)
import uos
from flashbdev import bdev
if bdev:
try:
uos.mount(bdev, "/")
except:
Reported by Pylint.
tests/basics/async_for2.py
8 issues
Line: 1
Column: 1
# test waiting within "async for" __anext__ function
try:
import usys as sys
except ImportError:
import sys
if sys.implementation.name == 'micropython':
# uPy allows normal generators to be awaitables
coroutine = lambda f: f
Reported by Pylint.
Line: 15
Column: 1
coroutine = types.coroutine
@coroutine
def f(x):
print('f start:', x)
yield x + 1
yield x + 2
return x + 3
Reported by Pylint.
Line: 15
Column: 1
coroutine = types.coroutine
@coroutine
def f(x):
print('f start:', x)
yield x + 1
yield x + 2
return x + 3
Reported by Pylint.
Line: 15
Column: 1
coroutine = types.coroutine
@coroutine
def f(x):
print('f start:', x)
yield x + 1
yield x + 2
return x + 3
Reported by Pylint.
Line: 21
Column: 1
yield x + 2
return x + 3
class ARange:
def __init__(self, high):
print('init')
self.cur = 0
self.high = high
Reported by Pylint.
Line: 34
Column: 9
async def __anext__(self):
print('anext')
print('f returned:', await f(20))
if self.cur < self.high:
val = self.cur
self.cur += 1
return val
else:
raise StopAsyncIteration
Reported by Pylint.
Line: 41
Column: 1
else:
raise StopAsyncIteration
async def coro():
async for x in ARange(4):
print('x', x)
o = coro()
try:
Reported by Pylint.
Line: 42
Column: 15
raise StopAsyncIteration
async def coro():
async for x in ARange(4):
print('x', x)
o = coro()
try:
while True:
Reported by Pylint.
tests/micropython/native_gen.py
8 issues
Line: 4
Column: 2
# test for native generators
# simple generator with yield and return
@micropython.native
def gen1(x):
yield x
yield x + 1
return x + 2
Reported by Pylint.
Line: 20
Column: 2
print(e.args[0])
# using yield from
@micropython.native
def gen2(x):
yield from range(x)
print(list(gen2(3)))
Reported by Pylint.
Line: 1
Column: 1
# test for native generators
# simple generator with yield and return
@micropython.native
def gen1(x):
yield x
yield x + 1
return x + 2
Reported by Pylint.
Line: 5
Column: 1
# simple generator with yield and return
@micropython.native
def gen1(x):
yield x
yield x + 1
return x + 2
Reported by Pylint.
Line: 5
Column: 1
# simple generator with yield and return
@micropython.native
def gen1(x):
yield x
yield x + 1
return x + 2
Reported by Pylint.
Line: 16
Column: 1
print(next(g))
try:
next(g)
except StopIteration as e:
print(e.args[0])
# using yield from
@micropython.native
def gen2(x):
Reported by Pylint.
Line: 21
Column: 1
# using yield from
@micropython.native
def gen2(x):
yield from range(x)
print(list(gen2(3)))
Reported by Pylint.
Line: 21
Column: 1
# using yield from
@micropython.native
def gen2(x):
yield from range(x)
print(list(gen2(3)))
Reported by Pylint.