C-extension in Python -- returning results
Delaney, Timothy
tdelaney at avaya.com
Thu Nov 8 22:13:45 EST 2001
> From: deoradh at yahoo.com [mailto:deoradh at yahoo.com]
>
> deoradh at yahoo.com (Keith Farmer) wrote in message
> news:<adec2554.0111070355.7dcdd7ac at posting.google.com>...
> > for (j = 1; j < 11; j++)
> > tpow[j] = tpow[j-1] * t0; /* tpow[j] =
> t0^j = tpow[j-1] * t0 */
> > sumsX[j] += tpow[j]; /* sumsX[j] = Sum(t0^j) */
>
> I misdiagnosed where the error was. Rule Zero of C-Programming: It's
> Not Python -- Remember Braces.
In all C-style languages (C/C++/Java, etc) my fingers automatically insert
the braces. The keystrokes are something like ... (non-printable keys
delimited by <>)
for (int i = 0; i < ...; i++)<enter - auto-indent>{<enter - auto-dedent>}<up
arrow><enter - auto-indent>...
Don't even think about it ... the braces are *always* there by the time I
start writing the enclosed code, properly indented.
Tim Delaney
More information about the Python-list
mailing list