Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 935d1b6

Browse files
committed
add more explanatory comments to for-else construct
1 parent eeb1a19 commit 935d1b6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3028,9 +3028,14 @@ def _capture_events(ax):
30283028
if _capture_events(ax):
30293029
break # break if we hit a capturing axes
30303030
else:
3031-
continue # continue to lower zorder if we did not break
3031+
# If the inner loop finished without an explicit break,
3032+
# (e.g. no capturing axes was found) continue the
3033+
# outer loop to the next zorder.
3034+
continue
30323035

3033-
break # break if we hit a capturing axes
3036+
# If the inner loop was terminated with an explicit break,
3037+
# terminate the outer loop as well.
3038+
break
30343039

30353040
# avoid duplicated triggers (but keep order of list)
30363041
pan_axes = list(dict.fromkeys(pan_axes))

0 commit comments

Comments
 (0)