[Python-3000] C API for ints and strings (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Sun Sep 9 15:24:37 CEST 2007
- Previous message: [Python-3000] C API for ints and strings
- Next message: [Python-3000] C API for ints and strings
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I actually need to convert it to mpzt, which is best done via text in a C string in a base which is a power of 2. Since PyUnicodeFormat for Python3 int creates a byte string first, it's quite silly to let a byte string be converted to a Unicode string and then back.
You could use _PyLong_AsByteArray.
Regards, Martin
- Previous message: [Python-3000] C API for ints and strings
- Next message: [Python-3000] C API for ints and strings
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]