On Oct 1, 2008, at 9:06 PM, Greg Ewing wrote: > Lisandro Dalcin wrote: > >> Mmm.. Perhaps some black magic in Cython? "i" is being used, and the >> generated code interprets this as a return flag for errors, with >> checks like if(unlikely(__pyx_1 == -1))) ... > > On further investigation, it seems it doesn't make a > difference in this situation. But "r" is conceptually > more correct, and it may become important in a future > version of Pyrex.
It seems an "r" means the returned result has no significance other than whether or not an error occurred, while an "i" is used to both flag an error and return a value. I suppose we should fix this (though it is rather low priority). As you mentioned, it could be used to make the optimized append return None as well instead of 0 (if anyone cares to look at it) by having the c_returncode_type coerce to an object using None. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
