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

M.-A. Lemburg mal at egenix.com
Thu Aug 14 21:50:59 CEST 2008


On 2008-08-14 07:10, Jesus Cea wrote:
> M.-A. Lemburg wrote:
> | BTW: If you make the database object subclassable, an application
> | could easily implement whatever strategy is needed on top of the
> | bytes-only interface.
> 
> Current pybsddb code don't allow subclassing or adding new attibutes to
> a given instance. I will (probably) work on this for a future pybsddb
> version. Pointers to references to do this kind of magic welcomed :-)

I can't give you a cookbook reference for converting existing
C extensions to subclassable ones, but if you look at e.g.
the code one of the more recently added builtin objects, you
should be able to extract the required details.

It's mostly about getting the constructors right and replacing
the attribute lookup code with getters/setters.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 14 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/
________________________________________________________________________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX 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


More information about the Python-3000 mailing list