Why tuple with one item is no tuple

Antoon Pardon apardon at forel.vub.ac.be
Fri Mar 18 07:07:10 EST 2005


Op 2005-03-18, Daniel Dittmar schreef <daniel.dittmar at sap.corp>:
> Antoon Pardon wrote:
>>>My peeve is about having operators added to standard types. This 
>>>increases the chances that using an object the wrong way leads to a 
>>>bogus result, not a runtime error. A more common programming error I 
>>>commit is passing a string where a list ist expected. And then I wonder 
>>>why later operations work on one-character strings.
>> 
>> 
>> The standard answer to this seems to be to use unittesting.
>> 
>
> I do detect that there is a problem. It just takes longer to find the 
> source of bogus data than to look at a stack trace.

Sure. But some language features would make finding the source of
some problems even faster. But when those arguments are made
the response is: use unittesting.

-- 
Antoon Pardon



More information about the Python-list mailing list