[Python-Dev] Any PEP about 2.6 -> 3000 code transition?

Gregory P. Smith greg at krypto.org
Sun May 25 09:18:38 CEST 2008


Of particular interest to bsddb is the pep3118 buffer API.  I updated
the existing bsddb module found in the py3k branch to use it last
fall; you may want to use the changes made to it as an example.

I agree, a single C code base is the only sane way forward for bsddb.
The interesting part is that you also want to support older python
versions (2.3-2.5?) as well so _bsddb.c & bsddb.h become a nice
example of how to write code that spans multiple python versions.

I expect it is less difficult than it sounds.

 http://www.python.org/dev/peps/pep-3118/

I believe the buffer api is supposed to be backported to 2.6?  I
haven't followed the status of that.  If so, bsddb should use it in
2.6 as well.

-gps

On Sat, May 24, 2008 at 9:25 PM, Jesus Cea <jcea at jcea.es> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I can't find any PEP about detailed 2.6 -> 3000 migration guidelines,
> specially in the module (C code) extension area. Yes, I know about the
> 2to3 tool, but I'm interested in updating my 2.x code in order to keep
> (automatic via "2to3") difference between 2.x and 3.x codebase so small
> as possible. Also, 2to3 doesn't manage migration for C modules.
>
> Since I need to port bsddb3 to py3k, what I need to know?. Is any
> *updated* document out there?.
>
> PS: My plan is keep working in the python side under 2.x, and manage
> Python 3.0 via "2to3", for a long time. In the C side, I plan keeping
> the same codebase, with conditional compilation. Ideas?.
>
> - --
> 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
>
> iQCVAwUBSDjqJplgi5GaxT1NAQLP3QP/Y2bWmNzHKsIq23dRz9sxd237TSfzbs5X
> UzEQ6Ze9Kv1lRXYRfiGjk37aOeiO4xqoKPfASc/WjMN/TmRkUNZxMQEQWwFYhmCA
> aAVqGxNMEX3KCXvRP9MkkZYLPa9RZg8boPTMYCn+uLDW1Ff2Pwj96hFKbWKG0dkJ
> RamNp8BFhkM=
> =ngK+
> -----END PGP SIGNATURE-----
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/greg%40krypto.org
>


More information about the Python-Dev mailing list