Simplify yield syntax

This commit is contained in:
Hugo Osvaldo Barrera 2021-10-30 19:39:17 +02:00 committed by Peter F. Patel-Schneider
parent df83fd655c
commit cf28308a9f
2 changed files with 3 additions and 6 deletions

View File

@ -115,8 +115,7 @@ def filter_receivers(bus_id, vendor_id, product_id):
def receivers(): def receivers():
"""Enumerate all the receivers attached to the machine.""" """Enumerate all the receivers attached to the machine."""
for dev in _hid.enumerate(filter_receivers): yield from _hid.enumerate(filter_receivers)
yield dev
def filter_devices(bus_id, vendor_id, product_id): def filter_devices(bus_id, vendor_id, product_id):
@ -129,8 +128,7 @@ def filter_devices(bus_id, vendor_id, product_id):
def wired_devices(): def wired_devices():
"""Enumerate all the USB-connected and Bluetooth devices attached to the machine.""" """Enumerate all the USB-connected and Bluetooth devices attached to the machine."""
for dev in _hid.enumerate(filter_devices): yield from _hid.enumerate(filter_devices)
yield dev
def filter_either(bus_id, vendor_id, product_id): def filter_either(bus_id, vendor_id, product_id):

View File

@ -204,8 +204,7 @@ class NamedInts:
return value in self.__dict__ or value in self._values return value in self.__dict__ or value in self._values
def __iter__(self): def __iter__(self):
for v in self._values: yield from self._values
yield v
def __len__(self): def __len__(self):
return len(self._values) return len(self._values)