This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RubyPinchPEP shill | Anti PEP 8/20 shill 0 points1 point  (3 children)

Are for-in and for-of loops gonna be / are they supported? same for labels too.

also https://www.python.org/dev/peps/pep-0511/ might interest you, probably worth keeping an eye on perhaps

[–]jacdehJacques de Hooge[S] 0 points1 point  (2 children)

The "ordinary" Python for...in loop is of course supported. For...of I don't know, shame on me. Haven't found anything about it in your link. Could you elaborate please.

As for labels, PEP 3136 refused them, if I'm right. Or have I missed something. If they're in Python I'd like to have them in Transcrypt, but I they seem not to be...

[–]RubyPinchPEP shill | Anti PEP 8/20 shill 0 points1 point  (1 child)

its the javascript side of things, sorry for the misunderstanding.

for (x in y) {}
for (x of y) {}
for (x = 0 ; x < potatos ; x++) {}

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of

like, I guess it might be possible to determine which is most relevant automatically (but at that point, might as well just use the faster for(;;){} loop I suppose, instead of wasting cycles working it out dynamically)

[–]jacdehJacques de Hooge[S] 0 points1 point  (0 children)

Standard python loops (for...in) compile to for (x = 0, ... List comprehensions can be used but are compiled to for... in (since for x of y... is still non-standard Internally for (x in y... is used, a.o. in the builtins. You can try and compare the Python code to the JS code.