On 01:44 am, http wrote:
exar...@twistedmatrix.com writes:
Although I think PyPy also recognizes this case and makes it as
efficient as using xrange, and does so without breaking any rules.

How can pypy possibly know that the user hasn't assigned some other
value to "range"?

It doesn't really need to. The optimization isn't applied when the compiler sees the name "range" being called. It's applied after the object the default builtin name "range" is bound to is called.

Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to