This is better as a list -- the lookups are much faster and in this case the speed really matters.  Try outputting a large line to the PDF backend for an example.

As an alternative, we could include the old list-based one as a private variable (used internally by `iter_segments`) and include this dictionary for external use.