On 5 September 2016 at 20:30, Steve Dower <steve.do...@python.org> wrote: > The only case we can reasonably handle at the raw layer is "n / 4" is zero > but n != 0, in which case we can read and cache up to 4 bytes (one wchar_t) > and then return those in future calls. If we try to cache any more than that > we're substituting for buffered reader, which I don't want to do. > > Does caching up to one (Unicode) character at a time sound reasonable? I > think that won't be much trouble, since there's no interference between > system calls in that case and it will be consistent with POSIX behaviour.
Caching a single character sounds perfectly OK. As I noted previously, my use case probably won't need to work at the raw level anyway, so I no longer expect to have code that will break, but I think that a 1-character buffer ensuring that we avoid surprises for code that was written for POSIX is a good trade-off. Paul _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com