def ranges(self, **kwargs):
"Iterate through all available ranges."
- ret = []
for i in range(self.get_n_ranges()):
- #yield self.subdevice(i, **kwargs)
- # Generators are not supported in Cython 0.14.1
- ret.append(self.get_range(i, **kwargs))
- return ret
+ yield self.get_range(i, **kwargs)
cdef class DigitalChannel (Channel):
def subdevices(self, **kwargs):
"Iterate through all available subdevices."
- ret = []
for i in range(self.get_n_subdevices()):
- #yield self.subdevice(i, **kwargs)
- # Generators are not supported in Cython 0.14.1
- ret.append(self.subdevice(i, **kwargs))
- return ret
+ yield self.subdevice(i, **kwargs)
def subdevice(self, index, factory=_subdevice.Subdevice, **kwargs):
return factory(device=self, index=index, **kwargs)
def channels(self, **kwargs):
"Iterate through all available channels."
- ret = []
for i in range(self.get_n_channels()):
- #yield self.channel(i, **kwargs)
- # Generators are not supported in Cython 0.14.1
- ret.append(self.channel(i, **kwargs))
- return ret
+ yield self.channel(i, **kwargs)
def channel(self, index, factory=_channel.Channel, **kwargs):
"`Channel` instance for the `index`\ed channel."