PartTree question #77
-
ray-optics/src/rayoptics/elem/parttree.py Line 262 in 1d16241 In the above code, the variable i is defined in the for loop, but also modified inside the loop. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is code that I hope I never have to change again... The use cases it's attempting to handle include:
The modification of i within the loop is intended and there are no side effects because every time thru the loop, the enumerate function returns a new value for i. I can't say that I'm proud of this code, but it works. |
Beta Was this translation helpful? Give feedback.
This is code that I hope I never have to change again... The use cases it's attempting to handle include:
The modification of i within the loop is intended and there are no side effects because every time thru the loop, the enumerate function returns a new value for i. I can't say that I'm proud of this code, but it works.