Skip to content

Commit 2698810

Browse files
authored
Merge pull request #461 from GeneCodeSavvy/fix-pylint-consider-using-enumerate
range replaced with enumerate
2 parents f41bf40 + 625cfd0 commit 2698810

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

sbol3/toplevel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
import copy
44
import math
55
import posixpath
6+
import typing
67
import urllib.parse
78
import uuid
89
import warnings
9-
from typing import Dict, Callable, Optional, Any
10-
import typing
10+
from typing import Any, Callable, Dict, Optional
1111

1212
from . import *
1313
from .typing import *
@@ -234,8 +234,8 @@ def update_references_traverser(x):
234234
if v.property_uri not in x._properties:
235235
continue
236236
items = x._properties[v.property_uri]
237-
for i in range(len(items)):
238-
str_item = str(items[i])
237+
for i, item in enumerate(items):
238+
str_item = str(item)
239239
if str_item in identity_map:
240240
new_reference = identity_map[str_item].identity
241241
# The item is probably an rdflib.URIRef. We take

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ disable = abstract-class-instantiated,
2020
implicit-str-concat,
2121
import-outside-toplevel,
2222
logging-not-lazy,
23-
consider-using-enumerate,
2423
consider-using-f-string,
2524
cyclic-import,
2625
duplicate-code,

test/test_component.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ def test_cloning_references(self):
148148
doc2 = sbol3.Document()
149149
doc2.add(toggle_clone)
150150
self.assertEqual(len(toggle.constraints), len(toggle_clone.constraints))
151-
for i in range(len(toggle.constraints)):
152-
c = toggle.constraints[i]
151+
for i, c in enumerate(toggle.constraints):
153152
c_clone = toggle_clone.constraints[i]
154153
self.assertNotEqual(c.identity, c_clone.identity)
155154
s = c.subject.lookup()

0 commit comments

Comments
 (0)