2 ms·
That does add a lot of redundant noise on each line, though. I would write this particular case as normal tuples which I would then turn into Keys in a separate
by tom_mellior 9y ago
That does add a lot of redundant noise on each line, though. I would write this particular case as normal tuples which I would then turn into Keys in a separate step:
keys = [Key(*tuple) for tuple in keys]
Another possibility is to keep the Key constructor on each line, but to get rid of the keyword arguments, which are not mandatory:
>>> Key('a', 'b', 'c', 'd')
Key(modifier='a', key='b', function='c', argument='d')