Skip to content

range replaced with enumerate#461

Merged
tcmitchell merged 5 commits intoSynBioDex:mainfrom
GeneCodeSavvy:fix-pylint-consider-using-enumerate
Mar 6, 2025
Merged

range replaced with enumerate#461
tcmitchell merged 5 commits intoSynBioDex:mainfrom
GeneCodeSavvy:fix-pylint-consider-using-enumerate

Conversation

@GeneCodeSavvy
Copy link
Copy Markdown
Contributor

@GeneCodeSavvy GeneCodeSavvy commented Mar 2, 2025

#433 Simple fix replacing range(len(items)) with enumerate(items)

Comment thread sbol3/toplevel.py Outdated
new_reference = identity_map[str_item].identity
for i, item in enumerate(items):
str_item = str(item)
if str(item) in identity_map:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if str(item) in identity_map:
if str_item in identity_map:

Comment thread sbol3/toplevel.py Outdated
for i, item in enumerate(items):
str_item = str(item)
if str(item) in identity_map:
new_reference = identity_map[str(item)].identity
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
new_reference = identity_map[str(item)].identity
new_reference = identity_map[str_item].identity

@tcmitchell
Copy link
Copy Markdown
Collaborator

This looks great. I think this PR should also include deleting consider-using-enumerate from setup.cfg. Do you agree, @GeneCodeSavvy ?

@GeneCodeSavvy
Copy link
Copy Markdown
Contributor Author

Yeah great idea, slipped my mind.

Thank you

@GeneCodeSavvy
Copy link
Copy Markdown
Contributor Author

Done

@tcmitchell tcmitchell merged commit 2698810 into SynBioDex:main Mar 6, 2025
@GeneCodeSavvy GeneCodeSavvy deleted the fix-pylint-consider-using-enumerate branch March 7, 2025 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants