[Python-porting] Port of psycopg2

M.-A. Lemburg mal at egenix.com
Tue Dec 9 13:23:22 CET 2008


On 2008-12-08 14:46, Mark Hammond wrote:
>>> Is there anyone else here for whom the step of "port to python 2.6"
>> is a deal-breaker?
>>
>> I'm not sure where the problems would lie in porting to Python 2.6
>> first.
> 
> It's more about moving to Python 2.6 syntax *only*.  eg, using 'bytes' or
> memory views etc as porting aids isn't that useful when targetting earlier
> versions.  Further, I meant "deal breaker" in a figurative sense - ie, not a
> real blocker, just an extra complication than what the "general" porting
> guide might bother considering - but by implication, something that might be
> worth addressing *somewhere*; eg, I'm finding '.encode('ascii')' a
> reasonable porting aid for bytes objects in many 'demo' byte literal cases,
> such as appending \0 chars, etc.
> 
> 'Cheers'.encode('ascii'), ly,

I think that one way or another you're going to end up using a
Python porting module that collects all the helpers you need to
support both Python 2 and 3.

The same is going to be needed for C extensions.

We're going to start moving all the Python version compatibility
stuff into a new module for our code base. For the C extensions
we already have a header file for the things we need in our
tools. With Python 3, we're likely going to have to complement this
with a separate C file for the various helper functions.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Dec 09 2008)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2008-12-02: Released mxODBC.Connect 1.0.0      http://python.egenix.com/

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the Python-porting mailing list