On Fri, Jun 9, 2023 at 10:19 PM <andy.shevchenko@xxxxxxxxx> wrote: > > Fri, Jun 09, 2023 at 11:36:06PM +0800, Kent Gibson kirjoitti: > > gpioset.py requests lines without setting their output value, and so > > sets them all inactive, and subsequently sets them to their requested > > value. This can result in glitches on lines which were active and > > are set active. > > > > As this is example code, it is also important to demonstrate that the > > output value can be set by the request itself. > > > > Request the lines with the correct output values set in the request > > itself. > > Do we need a comment in the code to specify this? > > ... > > > + config = dict([(l, settings(v)) for (l, v) in lvs]) > > Aren't [] not needed? > This is a list comprehension used to create the dictionary. Think: >>> config = dict([(1, 2), (3, 4)]) >>> config {1: 2, 3: 4} Bart > -- > With Best Regards, > Andy Shevchenko > >