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
Do you know that syntax trick? Probably a bit faster, too. If there are elements of a tuple that won't be used, they could be skipped (readability ("remindability") could be preserved with a comment):
for y, x, _, _, _, _ in P[2]: # y, x, i, dy, dx, g
map[y, x] = True
instead of the full form:
for y, x, i, dy, dx, g in P[2]:
map[y, x] = True
It could be done for any of the positions: for y, _, _, dy, _, g in P[2]: ... etc.
The text was updated successfully, but these errors were encountered:
Twenkid
changed the title
Skip-unpacking of selected tuple elements: for y,x, _, _, _, _ in P]2
Skip-unpacking of selected tuple elements: for y,x, _, _, _, _ in P[2]: ...
Mar 20, 2019
Thanks, I will keep that in mind. Right now it's mostly for
"remindability", less clutter than comments.
For speed, I plan to move to Julia when it gets too slow anyway.
Do you know that syntax trick? Probably a bit faster, too. If there are elements of a tuple that won't be used, they could be skipped (readability ("remindability") could be preserved with a comment):
instead of the full form:
It could be done for any of the positions:
for y, _, _, dy, _, g in P[2]:
... etc.https://stackoverflow.com/questions/9532576/ignore-part-of-a-python-tuple
CogAlg/frame_2D_alg/frame_blobs.py
Line 229 in 1ce8aa2
The text was updated successfully, but these errors were encountered: