A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-September/049064.html below:

[Python-Dev] Re: A cute new way to get an infinite loop

[Python-Dev] Re: A cute new way to get an infinite loop [Python-Dev] Re: A cute new way to get an infinite loopTerry Reedy tjreedy at udel.edu
Fri Sep 24 02:31:04 CEST 2004
"Tim Peters" <tim.peters at gmail.com> wrote in message 
news:1f7befae040923012645bc07f8 at mail.gmail.com...
>>>> x = [1]
>>>> x.extend(-y for y in x)

Very similar to this old way (2.2 and I presume before):
>>> l=[1]
>>> for i in l: l.append(i)
...
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
KeyboardInterrupt
>>> len(l)
1623613

but admittedly a bit more baroque ;-)

So, are things like this a programming bug, interpreter bug, or language 
definition bug?  or just a 'gotcha'?

Terry J. Reedy



More information about the Python-Dev mailing list

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