From b876d149f2759279a2100d23ce36d51e9f31fd14 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 3 Apr 2024 15:32:34 +1100 Subject: [PATCH] usb-device: Rename descriptor.append to extend. Nitpicky change, but what it does is closer to the latter wrt bytearrays and similar in Python. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton --- micropython/usb/usb-device/usb/device/impl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/micropython/usb/usb-device/usb/device/impl.py b/micropython/usb/usb-device/usb/device/impl.py index 328926f3..90606082 100644 --- a/micropython/usb/usb-device/usb/device/impl.py +++ b/micropython/usb/usb-device/usb/device/impl.py @@ -164,14 +164,14 @@ class _Device: # Determine the total length of the configuration descriptor, by making dummy # calls to build the config descriptor desc = Descriptor(None) - desc.append(initial_cfg) + desc.extend(initial_cfg) for itf in itfs: itf.desc_cfg(desc, 0, 0, []) # Allocate the real Descriptor helper to write into it, starting # after the standard configuration descriptor desc = Descriptor(bytearray(desc.o)) - desc.append(initial_cfg) + desc.extend(initial_cfg) for itf in itfs: itf.desc_cfg(desc, itf_num, ep_num, strs) @@ -603,8 +603,8 @@ class Descriptor: struct.pack_into(fmt, self.b, offs, *args) self.o = max(self.o, end) - def append(self, a): - # Append some bytes-like data to the descriptor + def extend(self, a): + # Extend the descriptor with some bytes-like data if self.b: self.b[self.o : self.o + len(a)] = a self.o += len(a)