python gripes survey

Josh joshway_without_spam at myway.com
Mon Aug 25 22:19:25 CEST 2003


sismex01 at hebmex.com wrote:
> [Afanasiy]
>>  Returning a struct in C is
>>  easier to deal with than returning a near-mystery tuple in Python.
>>

> You *really* *must* *be* *kidding*.

> -gustavo

It's really pretty easy:

  typedef struct {
    int x;
    int y;
  } T;

  T f() {
    T t = { 1, 2 };
    return t;
  }

  int main() {
    T t = f();
    return 0;
  }

And arguably easier to deal with than Python in that the fields are
named.  I think that's all Afanasiy was getting at.




More information about the Python-list mailing list