> But if `src_id` is less than 0, it'll fail the `len(sources)` check.

Um ... think that through again. : )

Maybe you meant if `src_id` fails the `>= 0` check, it will surely *pass* the `< len(sources)` check. That's true, just not relevant. The converse is also true, if `src_id` fails the `<len(sources)` check, it will surely *pass* the `>= 0` check, and that's not relevant either. The two failures are indeed mutually exclusive, but that doesn't matter since we are acting on *either* failure.

Anyway, this could equivalently be `if src_id not in xrange(0, len(sources))`, if you specifically dislike the chained-comparison syntax. Or more verbosely, `if src_id < 0 or src_id >= len(sources)`.

(Fixed to be a line comment; I previously commented on the pull request globally.)