[Python-3000] Extension modules moving to py3k (was: No beta2 tonight)

Mark Hammond mhammond at skippinet.com.au
Sat Jul 19 04:33:29 CEST 2008


Jesus wrote:

> I'm still loooking for a *GOOD* python2->python3 conversion guide for C
> language modules.

I was chatting with Raymond about that recently, and we agreed that this
will be a major challenge for extension authors moving forward.  Strategies
for dealing with your .py code are becoming clearer, but extension code will
be a problem, particularly for projects that can't abandon the 2.x series.
It seems very unlikely a strategy used for py code (eg, maintain in 2.6 and
use a conversion tool for 3.x) will work for C code - but some strategy will
be necessary as extensions become the bottle neck in preventing projects
moving to 3.x (your project only needs to use a single key extension that
doesn't exist on py3k, and your project is stuck)

It seems that it would be a huge help to extension authors if porting tricks
and hacks could be encapsulated in code that everyone can use.  In most
cases some cool tricks in header files might be all that is necessary, but
other cases may require special purpose helper functions designed purely to
aid people trying to keep code working in both environments. 

Roger Upole, one of the main pywin32 contributors, recently started an
attempt at porting pywin32 to py3k, and fell over at some fairly early
hurdles (eg, working out how to move C code that creates and returns buffer
objects to memory views), and I suspect each project will have a number of
unique challenges to overcome - so if we can share the *common* pain and let
them focus on their unique pain, 'dual-porting' efforts would stand a much
greater chance of success.
 
I'd love to help on this (even if the only reason is selfish - I believe
pywin32 will *need* it while 2.x remains important.)  Who would get involved
in such an effort?  How and where can we kick this off?

Cheers,

Mark



More information about the Python-3000 mailing list