[ANN] pysqlite 2.1.0 released
Gerhard Häring
gh at ghaering.de
Mon Jan 16 05:19:28 EST 2006
Alex Martelli wrote:
> Gerhard Häring <gh at ghaering.de> wrote:
> ...
>
>>An optimized shortcut has been enabled to retrieve Unicode strings for
>>non-ASCII data, but bytestrings for non-ASCII text:
>>
>> con.text_factory = sqlite.OptimizedUnicode
>
>
> I assume you mean "ASCII text" rather than "non-ASCII text" here?
You're right. I stole this idea from APSW, another SQLite wrapper, which
does this by default in order to reduce memory usage and increase
performance a little bit for the common use case of ASCII text.
You might argue that that this is premature optimization, but things
like this do make a difference if you process a lot of text.
Using this feature should be pretty compatible to the default of always
using Unicode, because `unicode` and `str` have pretty much the same
interface. But I wasn't 100 % sure, so I kept the old pysqlite default
of Unicode only and made the optimized case using OptimizedUnicode an
option.
> At any rate, my compliments for a new release (which looks great!) of a
> most excellent module!
Thanks :-)
-- Gerhard
More information about the Python-list
mailing list