Skip to content

Commit b876d14

Browse files
committed
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 <[email protected]>
1 parent 744f8c4 commit b876d14

File tree

1 file changed

+4
-4
lines changed
  • micropython/usb/usb-device/usb/device

1 file changed

+4
-4
lines changed

micropython/usb/usb-device/usb/device/impl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,14 @@ def maybe_set(value, idx):
164164
# Determine the total length of the configuration descriptor, by making dummy
165165
# calls to build the config descriptor
166166
desc = Descriptor(None)
167-
desc.append(initial_cfg)
167+
desc.extend(initial_cfg)
168168
for itf in itfs:
169169
itf.desc_cfg(desc, 0, 0, [])
170170

171171
# Allocate the real Descriptor helper to write into it, starting
172172
# after the standard configuration descriptor
173173
desc = Descriptor(bytearray(desc.o))
174-
desc.append(initial_cfg)
174+
desc.extend(initial_cfg)
175175
for itf in itfs:
176176
itf.desc_cfg(desc, itf_num, ep_num, strs)
177177

@@ -603,8 +603,8 @@ def pack_into(self, fmt, offs, *args):
603603
struct.pack_into(fmt, self.b, offs, *args)
604604
self.o = max(self.o, end)
605605

606-
def append(self, a):
607-
# Append some bytes-like data to the descriptor
606+
def extend(self, a):
607+
# Extend the descriptor with some bytes-like data
608608
if self.b:
609609
self.b[self.o : self.o + len(a)] = a
610610
self.o += len(a)

0 commit comments

Comments
 (0)