A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2003-June/036474.html below:

[Python-Dev] On the possibility of "optimizing" range() calls in for-loops

[Python-Dev] On the possibility of "optimizing" range() calls in for-loops [Python-Dev] On the possibility of "optimizing" range() calls in for-loopsGuido van Rossum guido@python.org
Thu, 19 Jun 2003 08:19:46 -0400
> >     www.python.org/sf/738094  for i in range(N) optimization 
> > 
> > The jury is still out on whether it is an elegant, brilliant patch or
> > a horrendous hack.

Isn't this flawed in the case where it's called by a C function rather
than directly from the bytecode VM?  If the C function was called in
the spot marked X below:

    for ... in X(...): ...

(where X is the C function that calls range(), probably through some
PyObject_Call() variation), then the check in the patch would trigger
incorrectly.

--Guido van Rossum (home page: http://www.python.org/~guido/)




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4