[Pyrex] Need pyrex performance advice

Greg Ewing greg at cosc.canterbury.ac.nz
Mon May 10 04:36:51 CEST 2004


David McNab <david at rebirthing.co.nz>:

> One solution I've thought of is to flatten the struct into a single 
> dict, with a dotted notation for keys. For example:
> 
>    Pyrex: ev.data.note.channel
> 
>    Python: ev['data.note.channel']
> 
> and building up this dict with a pure-c pyrex method using Python/C API 
> calls.

Rather than building another data structure, it might be
better to keep the existing C struct, wrapped in an extension
type, and provide access to its contents using attributes
such as data_note_channel.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+




More information about the Pyrex mailing list