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():
"""Enumerate all the receivers attached to the machine."""
for dev in _hid.enumerate(filter_receivers):
yield dev
yield from _hid.enumerate(filter_receivers)
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():
"""Enumerate all the USB-connected and Bluetooth devices attached to the machine."""
for dev in _hid.enumerate(filter_devices):
yield dev
yield from _hid.enumerate(filter_devices)
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
def __iter__(self):
for v in self._values:
yield v
yield from self._values
def __len__(self):
return len(self._values)