ANN: Pyrex 0.4.3

François Pinard pinard at
Tue Aug 27 21:27:22 EDT 2002

[Skip Montanaro]

> In contrast, stating something like

>     cdef int __builtin__.range(int, int, int)

> tries to force your notion of the range() builtin's prototype on other
> modules in the application, many of which may be out of your control.

Sorry, I am missing that point.  A cross-linguistic problem maybe?
I only want being able to tell Pyrex that it can safely compile range().
This has no incidence about how other modules behave besides the Pyrex one.

>     François> I'm quite ready to declare that `range' and `len' have their
>     François> usual meaning.  If I am not ready to this, I just will not.

> What happens if you are ready to declare this but the author of module A
> isn't? ;-)

I am missing the point here as well.  Let's presume that I wrote the Pyrex
module, and that "A" above means some other module I did not write, but
which is used in the overall application.

Pyrex has a few limitations about what other modules could do to alter
the interpretation it did while compiling.  I'm comfortable with that.
If was saying to Pyrex that such builtin has its "usual" meaning for
the Pyrex code I am currently writing, I exactly mean that.  That's OK.
Moreover, that's particularly OK if other modules modified `range', to have
the Pyrex module protected from such changes.  If I wanted to retain full
Python flexibility for `range' or any other built-in, then I would avoid
declaring it.  It might work the same way as for various other `cdef'
declarations, and I like the way Pyrex currently handle these.

In any case, I'll happily use whatever Greg decides we should use! :-)

François Pinard

More information about the Python-list mailing list