Misleading error message of the day

Jean-Michel Pichavant jeanmichel at sequans.com
Thu Dec 8 14:49:54 EST 2011


Roy Smith wrote:
> On Thursday, December 8, 2011 10:03:38 AM UTC-5, Jean-Michel Pichavant wrote:
>   
>> string are iterable, considering this, the error is correct.
>>     
>
> Yes, I understand that the exception is correct.  I'm not saying the exception should be changed, just that we have the opportunity to produce a more useful error message.  The exception would be equally correct if it was:
>
> ValueError: you did something wrong
>
> but most people would probably agree that it's not the most useful message that could have been produced.
>   
You have to opportunity to not use unpacking anymore :o) There is a 
recent thread were the dark side of unpacking was exposed. Unpacking is 
a cool feautre for very small applications but should be avoided 
whenever possible otherwise.

JM



More information about the Python-list mailing list