python gripes survey

Afanasiy abelikov72 at hotmail.com
Mon Aug 25 22:05:18 CEST 2003


On Mon, 25 Aug 2003 06:44:03 -0600, Dave Brueck <dave at pythonapocrypha.com>
wrote:

>On Monday 25 August 2003 12:14 pm, Afanasiy wrote:
>
>> I have a bunch, many of them hard to define, but one that I just thought
>> of I find strange sometimes is the use of tuples as near-mystery return
>> values. I can't help but thinking a C struct with named fields is easier
>> to remember than a tuple with fields accessed by integer.
>>
>> Sure you can return an associative array, but in my experience the
>> preference is to return a tuple. I'll probably get flamed for saying so,
>> but this is how I feel and it is unavoidable. Returning a struct in C is
>> easier to deal with than returning a near-mystery tuple in Python.
>
>A bit of an apples-to-oranges comparison, isn't it? If you prefer to return a 
>named structure in C, the Python equivalent certainly wouldn't be a tuple.

That's exactly my point. The Python equivalent certainly isn't a tuple.
The comparison with C is to explain, AND also happens to point to WHY code
like this exists in libraries which come with Python.




More information about the Python-list mailing list