And use it everywhere. Note there seemed to be a discrepancy between
heapq in Python 2 and 3, so I changed that. It should probably be more
widely used within heapq, but leaving that out of scope for this PR.
Co-authored-by: hauntsaninja <>
While it may eventually be useful to mark the exceptions that can be
raised from a function or method, the semantics are currently undefined
and unclear.