You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in python you can use for self.attr in list
this translates to for (var self.attr of list) which gives syntax error.
Need to generate temporary variable for iteration and assign it to attribute inside loop on first line:
for (var temp_iter of list) {
self.attr = temp_iter
...
in case where iterable is just an identifier, we can skip this extra assignment.
Another way could be to not write var when an object attribute accessor is used (or whatever Object.attribute is called). for SomeObject.attr in list would translate to for (SomeObject.attr of list).
Don't know which one is easier to implement.
Activity
AlexECX commentedon May 12, 2019
Another way could be to not write
varwhen an object attribute accessor is used (or whatever Object.attribute is called).for SomeObject.attr in listwould translate tofor (SomeObject.attr of list).Don't know which one is easier to implement.