3 ms·
Not really. The first two are consistent, but the last one is "get the only item and assert that there is only one item to get. If you don't care about the asse
by StavrosK 16y ago
Not really. The first two are consistent, but the last one is "get the only item and assert that there is only one item to get. If you don't care about the assertion, use [0], as always. I like the latter, because there's added info for the reader ("this should return a one-item iterable").
It's not really inconsistent, because you aren't performing the same operation in the two cases.