Skip to content

fix: use is None instead of == None (PEP 8 E711)#5650

Open
harshadkhetpal wants to merge 1 commit intoaws:masterfrom
harshadkhetpal:fix/pep8-is-none-templates
Open

fix: use is None instead of == None (PEP 8 E711)#5650
harshadkhetpal wants to merge 1 commit intoaws:masterfrom
harshadkhetpal:fix/pep8-is-none-templates

Conversation

@harshadkhetpal
Copy link

Summary

Fix PEP 8 E711 violation in sagemaker-core/src/sagemaker/core/tools/templates.py.

Change:

# Before
elif value == None or not value:

# After
elif value is None or not value:

Comparison to None should always use is or is not, never the equality operators (==/!=). This is because None is a singleton and identity comparison is both semantically correct and slightly more efficient.

Testing

No behavior change — this is a style/correctness fix. Existing tests continue to pass.

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