ANN: Pyrex 0.4.3
holger krekel
pyth at devel.trillke.net
Tue Aug 27 18:04:38 EDT 2002
Ram Bhamidipaty wrote:
> Skip Montanaro <skip at pobox.com> writes:
>
> > Bjorn> But surely in the context of Pyrex you could make assignment to
> > Bjorn> builtins illegal? (after all Pyrex isn't Python, it just looks
> > Bjorn> like it <wink>)
> >
> > You'll have to ask Greg. Even though Pyrex != Python, there is still a
> > price to be paid for what might seem like useful incompatibilities between
> > the two.
> >
>
>
> Why not just check if the range() object is the one that would have
> been returned by the builtin function? If the object is the normal
> one then you know you can generate C code - and if its not the normal
> one then you can stick to the curreny python behaviour... you get the
> speed you want without introducing a new syntax.
Checking for the "correct" builtin could only happen at runtime but
the C-stuff needs to be rendered at compile ("module creation") time.
But anyway, the whole 'for-loop-for-numbers' seems like a minor
optimization and i wouldn't introduce new syntax for it.
Even optimizing software like Pyrex can be prematurely optimized.
cheers,
holger
More information about the Python-list
mailing list