News for hackers. Stuff that matters.
Re:Python idiom for taking the single item from a list by durin42 on Monday September 27, 2010 @04:54PM (#1733372)
He's defending against None with the assert l and len(l) bit, or at least that's what I'd assume.
Re:Python idiom for taking the single item from a list by swolchok on Monday September 27, 2010 @05:18PM (#1733468)
If he's defending against None, he should

    assert l is not None and len(l) == 1