I found the mistake obvious, but I have some experience with Python.
The use of the `for ... in [...]` to destructure the list is quite clever.
I would have simply indexed the list.
The use of the `for ... in [...]` to destructure the list is quite clever.
I would have simply indexed the list.
(
(int(tsc, 16), int(pc, 16))
for tsc, _, pc, *_ in (line.strip().split(",") for line in fp)
),
Which is, of course, almost as ugly. Just use a for loop and yieldI think I would have written it like that:
def parse(line):
p = line.split(",")
return ((int(p[0], 16), int(p[2], 16))
(parse(line)) for line in fp)
And when it was still cool: map(parse, fp)