News for hackers. Stuff that matters.
Re:Python idiom for taking the single item from a list by cturner on Tuesday September 28, 2010 @02:30AM (#1734784)
What you say sounds right, but it's not. Using some DB APIs you'll get back a list of results, and you'll know from the SQL that it will only have one result.

Another example is if you know there is a single item in a data structure, and use list comprehension to extract it. You'll end up with a list of one item.

These situations happen, and for good reasons.

There are no comments on this comment yet.