Victor Stinner

Results 702 comments of Victor Stinner

Article about this performance problem in Python: https://lwn.net/Articles/816415/

> Curious if this warrants a further API PyUnicodeWriter_WriteStr(writer, obj) which appends repr(obj) I suppose that you mean `PyUnicodeWriter_WriteRepr()`. > Curious if this warrants a further API PyUnicodeWriter_WriteStr(writer, obj) which...

> (Yes, I meant WriteRepr.) I like these other helpers -- can we just add them all to the public API? Or are there issues with any of them? I...

> PyUnicodeWriter_WriteUCS4Char rather than PyUnicodeWriter_WriteChar -- character is an overloaded term, let's be specific. "WriteChar" name comes from PyUnicode_ReadChar() and PyUnicode_WriteChar() names. I don't think that mentioning UCS4 is useful....

> The proposed API is nice and minimal. My bet about what users will ask for next goes to PyUnicodeWriter_WriteUTF8String (for IO) & PyUnicodeWriter_WriteUTF16String (for Windows or Java interop). I...

> The proposed new C API allocates the data in dynamic memory, which makes it more portable and future proof. But this can add additional overhead. I ran benchmarks and...

I renamed functions: * `PyUnicodeWriter_WriteString()` => `PyUnicodeWriter_WriteUTF8()`: API with `const char *str`. * `PyUnicodeWriter_WriteStr()` => `PyUnicodeWriter_WriteString()`: API with `PyObject *str`. * `PyUnicodeWriter_FromFormat()` => `PyUnicodeWriter_Format()`.

@encukou: > I see the PR hides underscored API that some existing projects use. I thought we weren't doing that any more. Right, I would like to hide/remove the internal...

> This left us with the question what to do with Python strings. We can refer to them as "Unicode", such as: `PyUnicodeWriter_WriteUnicode()`. Even if the Python type is called...

About bikeshedding. PyPy provides `__pypy__.builders.StringBuilder` with `append()` and `build()` methods. Do you think that "String Builder" with `append` and `build` methods API (names) makes more sense than "Unicode Writer" with...