ANN: Pyrex 0.4.3
pinard at iro.umontreal.ca
Wed Aug 28 02:01:22 CEST 2002
> François> Maybe Pyrex should have some generic way to declare that one
> François> or more built-in, enumerated by name maybe, have dependably
> François> kept their default assignment and meaning.
> This is tough too. Pyrex compiles modules. What you're asking for is for a
> module author to make an invariant statement about the application as a
But Pyrex already invites authors to do this, by establishing contracts.
When I tell Pyrex `cdef char *text', I guarantee my intent about `text',
and Pyrex fills its share by producing fast access or usage to that variable.
If I do not declare a variable, Pyrex well protects its full generality.
I'm quite ready to declare that `range' and `len' have their usual meaning.
If I am not ready to this, I just will not. But if I do, then Pyrex might
react by translating these more efficiently, and even do something special
with `for VARIABLE in range(ARGUMENTS)'.
"About the application as a whole" is hyperbolic. Pyrex allows me to write
`cdef char *text' in global scope or just within a function. It could allow
me to choose the scope of a `len' or `range' declaration, just the same.
If it happens that I want the equivalent of a `for from' loop in a scope
where I do not want to declare `range' as having the usual meaning, then
it would not be hurt me much to write an explicit `while' loop instead:
you know as well as I do that those cases are to be quite seldom in practice.
François Pinard http://www.iro.umontreal.ca/~pinard
More information about the Python-list