Simplify yield syntax
This commit is contained in:
parent
df83fd655c
commit
cf28308a9f
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue