[Cython] Shared Cython runtime (was: Upcoming cython/numpy breakage with stride checking)

Nathaniel Smith njs at pobox.com
Tue Apr 9 16:22:02 CEST 2013


On Tue, Apr 9, 2013 at 3:15 PM, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Ok, got it now. That solves the distribution problem, assuming that all
> installed runtimes with a given version are equivalent. Basically, we'd
> move the code out and then cimport the stuff back that we need, which would
> then let the first import of a given runtime version insert it into
> sys.modules.

Yeah, that's the definition of "given version" :-), and any kind of
shared runtime does require versioning. If we wanted to be extra
careful we could put the shared code into its own block of boilerplate
that gets injected into each generated .c file, and then have the
"version" be the sha1 of that block of boilerplate... the trade-offs
depend on what exactly is getting shared.

> I so can't wait seeing the surprise in the eyes of our users when they let
> their IDE reorganise their import order and their code starts crashing. :]

That's easy to fix, just don't create such bugs ;-).

-n


More information about the cython-devel mailing list