News for hackers. Stuff that matters.
Re:Python idiom for taking the single item from a list by marcinw on Monday September 27, 2010 @01:54PM (#1732570)
http://docs.python.org/library/struct.html#struct.unpack

"""The result is a tuple even if it contains exactly one item."""

I run into this constantly using struct.unpack(), and I find the author's idiom to be ideal way to handle this. I will use this from now on.

There are no comments on this comment yet.