Hello custom cycles in python

Hello developers (of python) let’s do something… diffrend,
let’s give an opportunity to programmers make some cycles, some, his cycles.
its a good idea i tink… its will attract some auditory, big auditory, maybe,
and if you want to create it, you must return (or add) goto to python (or somthing similar (continue don’t count)) im from ukraine thanx :smiling_face_with_three_hearts: - zlfplololo

I’ve moved this to Help instead of Ideas because it seems like you’re unfamiliar with the many previous iterations of this idea, and the many reasons it won’t happen. Perhaps someone can point you to those and help explain the issues behind it.

I don’t really get what you mean with custom cycles but I assume that you are not happy with the already available loop mechanics? Then I have bad news because do-while was rejected and as can be seen from the message that was left the community isn’t too keen on adding any other types of loops [Python-ideas] PEP 315: do-while. Another Idea of adding more control to loops was labels for break and continue, but the pep was also rejected see PEP 3136 – Labeled break and continue | peps.python.org

And, I’m sorry to keep destroying your dreams, goto will never be added to Python.
I think these resources summarise the ‘why?’ pretty well:

COMMUNICATIONS OF THE ACM - Letters to the editor: go to statement considered harmful

xkcd 292

1 Like

no, like custom like not do-while (or something similar) like custom, custom like:

cycle while (boolr):
where (a) #in cycle while (boolr)
eval (code-in) #in cycle while (boolr)
if boolr: # in cycle while (boolr)
goto (a)` # in cycle while (boolr) and if boolr

sory i can’t tab

I don’t quite understand it. What is where (a) and eval (code-in) supposed to do?

You can use spaces tho, and you can wrap your examples with ``` to make code blocks :slightly_smiling_face:

if i use spase it make if boolr: eval("print('hello, world')")

where (a) - its like “:a” in batch
code-in - its a code after “:”

You can make a code block by using three backticks before the first line of code and after the last line of code like:
# Some code

# Some code

Okay thanks, now I do understand and I think you should learn about functions which pretty much do what you want and does not need any new loops or functions like goto which makes a language cluttered and worsens the readability. See:

that is common def in link, but my idea is like other, after this code in “cycle” is like "
while :
#code & in while
", is not like "
while (argument)

So while some_function():? Could you please make an real world example of how this would be used so I can understand it better? I’m sure that what you want is easily doable with functions and tools Python already offers

I don’t understand what you mean. Please format your code properly: place them inside backticks block, and indent with 4 spaces (not tabs).

its a good idea i tink… its will attract some auditory, big auditory, maybe,

Maybe, but you will get a much bigger audience if you make your code easy to read by properly formatting them.

we can make "
cycle fors(var):
count = 0
where (a)
var = count
for i in range(count, -1, 0)
#we are stoppyng for
if count !> len(code-in):
count +=1
goto (a)

it do line’s who not bigger var in count

If you want proper feedback on your suggestion, I would recommend not typing on phone (which I assume is why you can’t use tab) and read a bit about markdown formatting. Otherwise we are just going to be puzzled as to what you are trying to say.

i dont typing on fone

…raises ValueError: range() arg 3 must not be zero

Please provide a comparison of the proposed syntax and how it is currently done using the existing syntax.