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():
|
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):
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue