ironport/shrapnel — pull request #29 by samrushing (2012-06-18 21:26:01+00:00)
Title: Modernize pyrex -> cython

This started as an attempt to write a pxd file for _coro.pyx. It grew into a long-overdue modernizing of the pyrex code into cython. This means using the cpython cimport namespace rather than python.pxi (with the few exceptions instead placed at the top of _coro.pyx), and removing lots of redundant stuff like PyString_AsString. Much of this kinda thing is now done automatically by Cython, needing only a sprinkling of type annotations here and there.

I thought the best way to make a _coro.pxd was to mirror what is done in _coro.pyx - i.e., for each sub-component that is 'included', I make a pxd file for its types, and then 'include' that in _coro.pxd.

Motivation: with a pxd file, it is now possible to write pure-cython code, for example a server that is implemented completely in Cython, which should be quite competitive with a similar server written in C.

I also split socket.pyx::sock.parse_address() into pieces, and changed it to trigger off of the value of self.domain, rather than the type of the address argument. This is in preparation for support for linux raw sockets, which should be coming shortly...