2 Sep
2005
2 Sep
'05
2:57 a.m.
Fredrik> Python strings are character buffers with a known length, not Fredrik> null-terminated C strings. the CPython implementation Fredrik> guarantees that the character buffer has a trailing NULL Fredrik> character, but that's mostly to make it easy to pass Python Fredrik> strings directly to traditional C API:s. I'm obviously missing something that's been there all along. Since Python strings can contain NULs, why do we bother to NUL-terminate them? Clearly, any tradition C API that expects to operate on NUL-terminated strings would break with a string containing an embedded NUL. Skip