The following issues were found
tests/cpydiff/core_class_superproperty.py
8 issues
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.
Line: 9
Column: 1
"""
class A:
@property
def p(self):
return {"a": 10}
Reported by Pylint.
Line: 9
Column: 1
"""
class A:
@property
def p(self):
return {"a": 10}
Reported by Pylint.
Line: 9
Column: 1
"""
class A:
@property
def p(self):
return {"a": 10}
Reported by Pylint.
Line: 11
Column: 5
class A:
@property
def p(self):
return {"a": 10}
class AA(A):
@property
Reported by Pylint.
Line: 11
Column: 5
class A:
@property
def p(self):
return {"a": 10}
class AA(A):
@property
Reported by Pylint.
Line: 15
Column: 1
return {"a": 10}
class AA(A):
@property
def p(self):
return super().p
Reported by Pylint.
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
Line: 9
Column: 1
"""
class foo(object):
def __enter__(self):
print("Enter")
def __exit__(self, *args):
print("Exit")
Reported by Pylint.
Line: 9
Column: 1
"""
class foo(object):
def __enter__(self):
print("Enter")
def __exit__(self, *args):
print("Exit")
Reported by Pylint.
Line: 9
Column: 1
"""
class foo(object):
def __enter__(self):
print("Enter")
def __exit__(self, *args):
print("Exit")
Reported by Pylint.
Line: 17
Column: 1
print("Exit")
def bar(x):
with foo():
while True:
x += 1
yield x
Reported by Pylint.
Line: 17
Column: 1
print("Exit")
def bar(x):
with foo():
while True:
x += 1
yield x
Reported by Pylint.
Line: 17
Column: 1
print("Exit")
def bar(x):
with foo():
while True:
x += 1
yield x
Reported by Pylint.
Line: 24
Column: 1
yield x
def func():
g = bar(0)
for _ in range(3):
print(next(g))
Reported by Pylint.
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
Line: 1
Column: 1
import micropython
@micropython.native
def native_x(x):
print(x + 1)
@micropython.native
Reported by Pylint.
Line: 1
Column: 1
import micropython
@micropython.native
def native_x(x):
print(x + 1)
@micropython.native
Reported by Pylint.
Line: 5
Column: 1
@micropython.native
def native_x(x):
print(x + 1)
@micropython.native
def native_y(x):
Reported by Pylint.
Line: 5
Column: 1
@micropython.native
def native_x(x):
print(x + 1)
@micropython.native
def native_y(x):
Reported by Pylint.
Line: 10
Column: 1
@micropython.native
def native_y(x):
print(x + 1)
@micropython.native
def native_z(x):
Reported by Pylint.
Line: 10
Column: 1
@micropython.native
def native_y(x):
print(x + 1)
@micropython.native
def native_z(x):
Reported by Pylint.
Line: 15
Column: 1
@micropython.native
def native_z(x):
print(x + 1)
Reported by Pylint.
Line: 15
Column: 1
@micropython.native
def native_z(x):
print(x + 1)
Reported by Pylint.
tests/cmdline/cmd_parsetree.py
8 issues
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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
Line: 12
Column: 1
print(3)
f()
def f(l, i):
try:
return l[i]
except IndexError:
print('IndexError')
return -1
Reported by Pylint.
Line: 7
Column: 5
try:
print(1)
return
except:
print(2)
print(3)
f()
def f(l, i):
Reported by Pylint.
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.
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.
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.
Line: 12
Column: 1
print(3)
f()
def f(l, i):
try:
return l[i]
except IndexError:
print('IndexError')
return -1
Reported by Pylint.
Line: 12
Column: 1
print(3)
f()
def f(l, i):
try:
return l[i]
except IndexError:
print('IndexError')
return -1
Reported by Pylint.
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
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
Line: 34
Column: 1
os.mount(sd, "/")
def list():
files = os.listdir()
print(files)
Reported by Pylint.
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.
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.
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.
Line: 34
Column: 1
os.mount(sd, "/")
def list():
files = os.listdir()
print(files)
Reported by Pylint.
tests/float/float_compare.py
8 issues
Line: 1
Column: 1
# Extended float comparisons
class Foo:
pass
foo = Foo()
Reported by Pylint.
Line: 4
Column: 1
# Extended float comparisons
class Foo:
pass
foo = Foo()
Reported by Pylint.
Line: 4
Column: 1
# Extended float comparisons
class Foo:
pass
foo = Foo()
Reported by Pylint.
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.
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.
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.
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.
Line: 22
Column: 11
print("TypeError")
try:
print(1.0 < foo)
except TypeError:
print("TypeError")
Reported by Pylint.