Am 06/04/2008 11:59 PM schrieb Dag Sverre Seljebotn:
Johannes Wienke wrote:Am 06/04/2008 07:47 PM schrieb Stefan Behnel:If you *really* want None, then you can use something like this:cdef inline stringOrNone(char* value): if value is NULL: return None return valueThat's exactly what I'm doing now but that's error-prone as you have to do this manually and can forget it.(Sorry about telling you to reread, I can see that you commented on it already.)Well, in my mind, this is a reason for supporting Stefan in removing auto-coercion of char* to Python strings altogether (that is suggested once down in those unicode discussion threads, right Stefan?). Then you would get a nice compiler error when you forget it, and it won't be error-prone.
Now with the context of encoding issues I can see the point. Things you don't have to think of to often as Java developer. ;) Removing the conversion then would be a good idea. Compiler warnings are of course the best bug prevention. On the other hand this really handy... Hard to decide.
- Johannes
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
