[Tutor] Any interest in a tutorial for writing a Python C extension?

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Sun, 31 Mar 2002 23:26:50 -0800 (PST)


[Note: skip this message if you haven't fiddled around with C extensions
yet.]


Hi everyone,

Out of curiosity, is anyone interested in helping to edit a tutorial for
writing a Python extension?


I'm thinking of writing one for a module I'm starting to write called
"FileString"; it tries to make a file-like object look almost like a
string.  The book "Object Oriented Perl", by Damian Conway, has an example
of a module called "Genome::Array" that caught my eye.  Such a module
might be useful for people dealing with huge sequences, and I think it
might be nice to have an equivalent class in Python.


Also, there was discussion a while back about why re.search() would give
an odd message about a "read-only string or buffer".  What distinction
does the term "buffer"  mean, if the only object that implements it is the
string type?  *grin* So I'm hoping I can have FileString implement the
"buffer" interface so that it becomes fairly easy to do regular
expressions on very large files.


My plan is to write an introductory tutorial for people who are reading
the "Extending and Embedding" document on python.org:

    http://python.org/doc/current/ext/ext.html

as an extended case study.  But to tell the truth, I haven't really
written a serious C extension before, so that's why I'll like some
collaborators to share the blame.  *grin*


If anyone's interested, please feel free to email me.  Talk to you later!