python gripes survey

Grant Edwards grante at visi.com
Mon Aug 25 22:20:57 CEST 2003


In article <oprug80dwe5ctagx at localhost>, Jordan Krushen wrote:
> On Mon, 25 Aug 2003 19:45:10 GMT, Afanasiy <abelikov72 at hotmail.com> wrote:
> 
>> Yes, returning multiple values, ie. tuples, is useful, but using them as
>> you would use structs in C is common and the root of my gripe. The 
>> problem
>> I explained above has nothing to do with the code you write. The problem
>> is knowing what integer position in the tuple represents what field. In C
>> structs have named fields, but in Python tuple have integer fields. The
>> meaning of tuple integer fields, for tuples used this way, is only known
>> in the documentation, not the code directly.
> 
> I agree here.  Returning tuples is only useful when very few
> arguments are being returned.

In my experience, two is the maximum useful value.  I don't
have t0o much trouble remembering the order of a pair of
returned values, but with three or more, I often get it wrong.

-- 
Grant Edwards                   grante             Yow!  I'd like MY data-base
                                  at               JULIENNED and stir-fried!
                               visi.com            




More information about the Python-list mailing list