[Pyrex] Pybsddb question

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Apr 13 04:37:53 CEST 2006


tarkawebfoot at charter.net wrote:

> I guess this isn't suprising since the __call__ function is called by 
> Python. The parameters are going to be passed as Python objects. 
> So the question is, how do I convert them to DBT objects? 

There's nothing called DBT defined in the code you
posted. I'm guessing it's some C struct defined by
bsddb, in which case whatever is making the Python
call to your method must be passing it some kind
of Python object that's wrapping a DBT.

In that case, you'll have to consult the source
of pybsddb and find out enough about that object
type to declare it to Pyrex as an external
extension type, and extract a DBT * from it.
Read up about "External extension types"
in the Language Overview:

http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/version/Doc/extension_types.html#ExternalExtTypes

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiam!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+



More information about the Pyrex mailing list