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

Jesus Cea jcea at jcea.es
Mon Jul 21 11:48:05 CEST 2008


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

Lennart Regebro wrote:
| On Mon, Jul 21, 2008 at 11:06, Jesus Cea <jcea at jcea.es> wrote:
|> I'm *VERY* interested in 2.6->3.0 migration guide for C module
|> extensions. 3.0 is around the corner and the API is changing almost
|> daily :-p.
|
| It would be great if python-incompatibility would have examples of the
| C-api changes as well. That would really help in migrating and writing
| a migration guide. It would be great if you could help with this!

I can comment about some issues I had this weekend.

Remember that my intention is to keep a single C codebase for 2.6 and 3.0.

* Int/Long integration. In Python 3.0 "PyInt_*" has vanished. But using
"PyLong_*" in Python 2.x surfaces so many issues that I have decided to
define "NUMBER_*" macros to be conditionally expanded to
"PyInt"/"PyLong" when compiling to 2.x/3.0. Not nice, but I can't see a
better way.

* The module initialization has changed completely. In fact I am
fighting this, still. Some help needed.

* "Py_FindMember" was eliminated ?last week?. I workaround this, but I
don't know really how to write a "smart" getattr function now. Any pointer?

At least my current code compiles under 3.0, but it still bombs when
importing it.

Life sucks.

PS: I'm learning the hard way, doing "diff" between 2.6 and 3.0 module
sourcecode. It must be a better way!.

- --
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

iQCVAwUBSIRbTplgi5GaxT1NAQJTBAP/cHndbYfnpNF+UoJP0vswoJrMtrNRu6F4
TAAMGbv4sfE5a308sfjoXxFuvUA8kXAyqdJCMXlNWDfX6CEsozQwoS06d6HNkkZn
k9iGEbjwiWVdcw0y6gXvt9rL+klK004Rg4pUHMYtO3yUbaFSqvCI1kox6Rf1Q4dB
3CywJ2/fAu4=
=V42Q
-----END PGP SIGNATURE-----


More information about the Python-Dev mailing list