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

Skip to content

Commit 74aeb10

Browse files
authored
Eliminates Unneeded Iterator
Addresses the 'y appears unused' issue.
1 parent 83e6395 commit 74aeb10

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

examples/user_interfaces/svg_tooltip.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@
6565
tree, xmlid = ET.XMLID(f.getvalue())
6666
tree.set('onload', 'init(evt)')
6767

68-
for i, y in enumerate(shapes):
68+
for i in enumerate(shapes):
6969
# Hide the tooltips
70-
tooltip = xmlid['mytooltip_{:03d}'.format(i)]
70+
tooltip = xmlid['mytooltip_{:03d}'.format(i[0])]
7171
tooltip.set('visibility', 'hidden')
7272
# Assign onmouseover and onmouseout callbacks to patches.
73-
mypatch = xmlid['mypatch_{:03d}'.format(i)]
73+
mypatch = xmlid['mypatch_{:03d}'.format(i[0])]
7474
mypatch.set('onmouseover', "ShowTooltip(this)")
7575
mypatch.set('onmouseout', "HideTooltip(this)")
7676

0 commit comments

Comments
 (0)