chaimleib / intervaltree

A mutable, self-balancing interval tree. Queries may be by point, by range overlap, or by range containment.
Apache License 2.0
636 stars 108 forks source link

Plain try/except statement #99

Closed alexpovel closed 2 years ago

alexpovel commented 4 years ago

In Interval.py, there are 3 except statements without specified exceptions (and one in node.py).

In the linked Interval.py line, this should probably be an AttributeError. I imagine the naked except statements work well enough since the try blocks are so tight, but equipping all excepts with exceptions is still a good thing to do (naked excepts catch KeyboardInterrupt etc.). Also helps in understanding the code's intention ("points aka normal scalar numeric types do not have an attribute begin or end, therefore execute the except block content").

If you agree with the above and I did not get this wrong, I can create a PR for this.