The comment here is literally just explaining the logic here in the same terms. To me, that's a sign that this is to dense to be a one-liner.
```
if next_el.num != num_id:
    # The next element is a new list entirely
    return False
if next_el.ilvl < ilvl:
    # The next element is de-indented, so this is really the last element in the list
    return False
return True
```