The following issues were found
tests/float/float_array.py
4 issues
Line: 8
Column: 9
from array import array
except ImportError:
print("SKIP")
raise SystemExit
def test(a):
print(a)
a.append(1.2)
Reported by Pylint.
Line: 1
Column: 1
try:
from uarray import array
except ImportError:
try:
from array import array
except ImportError:
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 11
Column: 1
raise SystemExit
def test(a):
print(a)
a.append(1.2)
print(len(a), "%.3f" % a[0])
a.append(1)
a.append(False)
Reported by Pylint.
Line: 11
Column: 1
raise SystemExit
def test(a):
print(a)
a.append(1.2)
print(len(a), "%.3f" % a[0])
a.append(1)
a.append(False)
Reported by Pylint.
tests/float/float_struct.py
4 issues
Line: 5
Column: 5
try:
try:
import ustruct as struct
except:
import struct
except ImportError:
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 9
Column: 5
import struct
except ImportError:
print("SKIP")
raise SystemExit
i = 1.0 + 1 / 2
# TODO: it looks like '=' format modifier is not yet supported
# for fmt in ('f', 'd', '>f', '>d', '<f', '<d', '=f', '=d'):
for fmt in ("f", "d", ">f", ">d", "<f", "<d"):
Reported by Pylint.
Line: 12
Column: 3
raise SystemExit
i = 1.0 + 1 / 2
# TODO: it looks like '=' format modifier is not yet supported
# for fmt in ('f', 'd', '>f', '>d', '<f', '<d', '=f', '=d'):
for fmt in ("f", "d", ">f", ">d", "<f", "<d"):
x = struct.pack(fmt, i)
v = struct.unpack(fmt, x)[0]
print("%2s: %.17f - %s" % (fmt, v, (i == v) and "passed" or "failed"))
Reported by Pylint.
Line: 1
Column: 1
# test struct package with floats
try:
try:
import ustruct as struct
except:
import struct
except ImportError:
print("SKIP")
raise SystemExit
Reported by Pylint.
tests/float/math_factorial_intbig.py
4 issues
Line: 4
Column: 5
try:
import math
math.factorial
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 7
Column: 5
math.factorial
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
for fun in (math.factorial,):
for x in range(-1, 30):
try:
Reported by Pylint.
Line: 1
Column: 1
try:
import math
math.factorial
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 14
Column: 9
for x in range(-1, 30):
try:
print("%d" % fun(x))
except ValueError as e:
print("ValueError")
Reported by Pylint.
tests/float/string_format_modulo2.py
4 issues
Line: 4
Column: 10
# test formatting floats with large precision, that it doesn't overflow the buffer
def test(num, num_str):
if num == float("inf") or num == 0.0 and num_str != "0.0":
# skip numbers that overflow or underflow the FP precision
return
for kind in ("e", "f", "g"):
# check precision either side of the size of the buffer (32 bytes)
Reported by Pylint.
Line: 1
Column: 1
# test formatting floats with large precision, that it doesn't overflow the buffer
def test(num, num_str):
if num == float("inf") or num == 0.0 and num_str != "0.0":
# skip numbers that overflow or underflow the FP precision
return
for kind in ("e", "f", "g"):
# check precision either side of the size of the buffer (32 bytes)
Reported by Pylint.
Line: 4
Column: 1
# test formatting floats with large precision, that it doesn't overflow the buffer
def test(num, num_str):
if num == float("inf") or num == 0.0 and num_str != "0.0":
# skip numbers that overflow or underflow the FP precision
return
for kind in ("e", "f", "g"):
# check precision either side of the size of the buffer (32 bytes)
Reported by Pylint.
Line: 12
Column: 13
# check precision either side of the size of the buffer (32 bytes)
for prec in range(23, 36, 2):
fmt = "%." + "%d" % prec + kind
s = fmt % num
check = abs(float(s) - num)
if num > 1:
check /= num
if check > 1e-6:
print("FAIL", num_str, fmt, s, len(s), check)
Reported by Pylint.
tests/float/string_format_modulo2_intbig.py
4 issues
Line: 4
Column: 10
# test formatting floats with large precision, that it doesn't overflow the buffer
def test(num, num_str):
if num == float("inf") or num == 0.0 and num_str != "0.0":
# skip numbers that overflow or underflow the FP precision
return
for kind in ("e", "f", "g"):
# check precision either side of the size of the buffer (32 bytes)
Reported by Pylint.
Line: 1
Column: 1
# test formatting floats with large precision, that it doesn't overflow the buffer
def test(num, num_str):
if num == float("inf") or num == 0.0 and num_str != "0.0":
# skip numbers that overflow or underflow the FP precision
return
for kind in ("e", "f", "g"):
# check precision either side of the size of the buffer (32 bytes)
Reported by Pylint.
Line: 4
Column: 1
# test formatting floats with large precision, that it doesn't overflow the buffer
def test(num, num_str):
if num == float("inf") or num == 0.0 and num_str != "0.0":
# skip numbers that overflow or underflow the FP precision
return
for kind in ("e", "f", "g"):
# check precision either side of the size of the buffer (32 bytes)
Reported by Pylint.
Line: 12
Column: 13
# check precision either side of the size of the buffer (32 bytes)
for prec in range(23, 36, 2):
fmt = "%." + "%d" % prec + kind
s = fmt % num
check = abs(float(s) - num)
if num > 1:
check /= num
if check > 1e-6:
print("FAIL", num_str, fmt, s, len(s), check)
Reported by Pylint.
tests/import/pkg3/mod1.py
4 issues
Line: 2
Column: 1
print("mod1 __name__:", __name__)
from . import mod2
Reported by Pylint.
Line: 2
Column: 1
print("mod1 __name__:", __name__)
from . import mod2
Reported by Pylint.
Line: 1
Column: 1
print("mod1 __name__:", __name__)
from . import mod2
Reported by Pylint.
Line: 2
Column: 1
print("mod1 __name__:", __name__)
from . import mod2
Reported by Pylint.
tests/import/pkg3/subpkg1/mod1.py
4 issues
Line: 2
Column: 1
print("subpkg1.mod1 __name__:", __name__)
from ..mod2 import foo
Reported by Pylint.
Line: 2
Column: 1
print("subpkg1.mod1 __name__:", __name__)
from ..mod2 import foo
Reported by Pylint.
Line: 1
Column: 1
print("subpkg1.mod1 __name__:", __name__)
from ..mod2 import foo
Reported by Pylint.
Line: 2
Column: 1
print("subpkg1.mod1 __name__:", __name__)
from ..mod2 import foo
Reported by Pylint.
tests/import/rel_import_inv.py
4 issues
Line: 2
Column: 5
try:
from . import foo
except:
print("Invalid relative import caught")
Reported by Pylint.
Line: 2
Column: 5
try:
from . import foo
except:
print("Invalid relative import caught")
Reported by Pylint.
Line: 3
Column: 1
try:
from . import foo
except:
print("Invalid relative import caught")
Reported by Pylint.
Line: 1
Column: 1
try:
from . import foo
except:
print("Invalid relative import caught")
Reported by Pylint.
examples/accel_i2c.py
4 issues
Line: 7
Column: 1
# example. For the latter, using pyb.Accel class is
# much easier.
from machine import Pin
from machine import I2C
import time
# Accelerometer needs to be powered on first. Even
# though signal is called "AVDD", and there's separate
Reported by Pylint.
Line: 8
Column: 1
# much easier.
from machine import Pin
from machine import I2C
import time
# Accelerometer needs to be powered on first. Even
# though signal is called "AVDD", and there's separate
# "DVDD", without AVDD, it won't event talk on I2C bus.
Reported by Pylint.
Line: 1
Column: 1
# This is an example on how to access accelerometer on
# PyBoard directly using I2C bus. As such, it's more
# intended to be an I2C example, rather than accelerometer
# example. For the latter, using pyb.Accel class is
# much easier.
from machine import Pin
from machine import I2C
import time
Reported by Pylint.
Line: 9
Column: 1
from machine import Pin
from machine import I2C
import time
# Accelerometer needs to be powered on first. Even
# though signal is called "AVDD", and there's separate
# "DVDD", without AVDD, it won't event talk on I2C bus.
accel_pwr = Pin("MMA_AVDD")
Reported by Pylint.
ports/rp2/boards/manifest.py
4 issues
Line: 1
Column: 1
freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
Reported by Pylint.
Line: 2
Column: 1
freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
Reported by Pylint.
Line: 3
Column: 1
freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
Reported by Pylint.
Line: 1
Column: 1
freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
Reported by Pylint.