Remove comma from tuples in python.

Tim Chase python.list at tim.thechases.com
Fri Feb 21 13:07:00 EST 2014


On 2014-02-21 09:48, Travis Griggs wrote:
> I’ve used the comma form with struct.unpack() frequently:
> 
> count, = struct.unpack(‘!I’, self.packet)

This is *especially* one of those places I want extra parens to make
sure I see what's happening. I've been stung too many times by the
easy-to-miss nature of just a single comma.

-tkc




More information about the Python-list mailing list