[New-bugs-announce] [issue6207] Simple For-Loops

Gabriel Koritzky report at bugs.python.org
Fri Jun 5 17:54:36 CEST 2009


New submission from Gabriel Koritzky <naoehomeuemail at gmail.com>:

I don't know if something like this has been said before, so if it did
just ignore this.

I have noticed that very few programming languages use simple for loops.
Python itself doesn't have a really simple one. So here's my suggestion:

for ( value ):
# Repeats the code that follows 'value' times if value is an integer. If
it's a string or a list, repeats the code once per character or instance
on 'value'.

for ( iniINC , finalEXC ):
# Repeats the code that follows 'finalEXC - iniINC' times if they're
integers.

for ( variable , iniINC , finalEXC ):
# Assigns iniINC to variable and raises it by one until it reaches
finalEXC (not executing when it does).

#example1
for 70:
	doNothing()

#example2
a = 10
for a:
	doNothing()

#example3
a = 5
for ( a , 10 ):
	doNothing()

#example4
i = 0
for ( i , 10 , 20 ):
	doNothing()

----------
messages: 88950
nosy: gabrielkfl
severity: normal
status: open
title: Simple For-Loops

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6207>
_______________________________________


More information about the New-bugs-announce mailing list