Message99856
Could you add a comment on why you're calling PyUnicode_FromString and then throwing away the result? I believe it's so you'll get the same error checking as PyUnicode_FromString, but it's sufficiently tricky that I think it deserves a comment.
Now that I think about it, having done the conversion in PyUnicode_FromString, why not use:
buf[0] = PyUnicode_AS_UNICODE(s)[0];
? This way you skip the cast and you know for a fact you're using the same interpretation as PyUnicode_FromString, having used its output.
Also, since you know the size you may as well call PyUnicode_FromStringAndSize. It's trivially faster and makes the intent clearer, I think. |
|
Date |
User |
Action |
Args |
2010-02-22 22:20:57 | eric.smith | set | recipients:
+ eric.smith, doerwalter, vstinner, ezio.melotti, flox |
2010-02-22 22:20:57 | eric.smith | set | messageid: <1266877257.75.0.736836990506.issue7649@psf.upfronthosting.co.za> |
2010-02-22 22:20:56 | eric.smith | link | issue7649 messages |
2010-02-22 22:20:55 | eric.smith | create | |
|