[Python-3000] Bytes and unicode conversion in C extensions

Jesus Cea jcea at jcea.es
Thu Aug 14 06:33:05 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin v. Löwis wrote:
|> So, I'm thinking seriously in accepting *ONLY* "bytes" in the bsddb API
|> (when working under Python 3.0), and do the proxy thing *ONLY* in the
|> testsuite, to be able to reuse it.
|>
|> What do you think?.
|
| I think you should write the test suite in terms of bytes.

The problem is that pybsddb must work in python 2.3, 2.4, 2.5, 2.6 and 3.0.

My final approach was to write some proxy/adapter objects to manage the
unicode<->bytes conversion, so being able to share testsuite and
basecode between all pybsddb supported platforms.

Not the nicest thing to do, but the the bulk of code is unchanged and
fully shared in any supported python version. The adapter code is big,
but isolated.

Some code would be simplest if pybsddb classes allowed subclassing. This
is in my "todo" list.

- --
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea at jcea.es - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
jabber / xmpp:jcea at jabber.org         _/_/    _/_/          _/_/_/_/_/
.                              _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBSKO1e5lgi5GaxT1NAQIR1QP+IRAATC3K/BNYzSjxj+hn9oKqhpG+IJcv
Jl05MPHd1+/GMpD/Fzug8dZ0POG202DXoyD6a5R2lJlkPT/5R+8G170FQMXaO2EV
Df6juuWjMlg4CRUvSmX62uHWPGs70YtD6j+M26sQaMqUQckUNiIdKnjKYgaQa0tI
rbNWCF0wr7g=
=PL4N
-----END PGP SIGNATURE-----


More information about the Python-3000 mailing list