Skip to content

Update make_output_files.py#24

Open
AbhinavSinghKuriya wants to merge 1 commit intoOICR:mainfrom
AbhinavSinghKuriya:patch-1
Open

Update make_output_files.py#24
AbhinavSinghKuriya wants to merge 1 commit intoOICR:mainfrom
AbhinavSinghKuriya:patch-1

Conversation

@AbhinavSinghKuriya
Copy link
Copy Markdown

Python string comparison using "is" instead of "=="

While exploring the repository, I noticed that in Sandbox/make_output_files.py, string comparison is done using "is":

if args.heatmap is "F":

In newer Python versions, this may lead to unpredictable behavior since "is" checks object identity rather than value equality. It might be safer to use "==".

I would be happy to submit a pull request to fix this and check for similar cases across the repository.

Python string comparison using "is" instead of "=="

Description:
While exploring the repository, I noticed that in Sandbox/make_output_files.py,
string comparison is done using "is":

if args.heatmap is "F":

In newer Python versions, this may lead to unpredictable behavior since "is"
checks object identity rather than value equality. It might be safer to use "==".

I would be happy to submit a pull request to fix this and check for similar
cases across the repository.
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.

1 participant