In Python, you can use the _ field to grab the last computed value.
- grab the last computed value
- tell the reader the value is not used, as a way to increase readiability
ids = [id for id, _ in doc]
means that from each “doc” you get two
things: id, and something else BUT this something is being ignored for now
(presumably because it is not needed )
>>> [i for i,_ in a] [1, 3]