Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Python idiom for taking the single item from a list. Parent comment
"""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.
"""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.