You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pylint's output (if you look at the actions report, there were two other issues pylint had, but they were pretty straightforward)
************* Module adafruit_miniesptool
adafruit_miniesptool.py:330:0: R1721: Unnecessary use of a comprehension (unnecessary-comprehension)
adafruit_miniesptool.py:331:0: R1721: Unnecessary use of a comprehension (unnecessary-comprehension)
adafruit_miniesptool.py:332:0: R1721: Unnecessary use of a comprehension (unnecessary-comprehension)
Not really sure what's going on here, but this is the code that pylint didn't like:
packet = [0xC0, 0x00] # direction
packet.append(opcode)
packet += [x for x in struct.pack("H", len(buffer))]
packet += [x for x in self.slip_encode(struct.pack("I", checksum))]
packet += [x for x in self.slip_encode(buffer)]
packet += [0xC0]
I think it because the first portion of a comprehension is usually more than just x again. Usually there is a transformation there.
My guess is that these were used to convert sequences to lists. Instead, I'd recommend changing them to packet.extend(struct.pack("H", len(buffer))). I believe that will work to append to the packet list.
Pylint's output (if you look at the actions report, there were two other issues pylint had, but they were pretty straightforward)
Not really sure what's going on here, but this is the code that pylint didn't like:
Referencing main issue: adafruit/Adafruit_CircuitPython_Bundle#232
The text was updated successfully, but these errors were encountered: