Skip to content

Conversation

@larsks
Copy link
Member

@larsks larsks commented Mar 25, 2025

The is operator checks for identity, not equality. To check for an empty
list, one should use either:

if roles == []:

Or just take advantage of the fact that an empty list is False when used
in a boolean expression, and write:

if not roles:

This commit takes the second option.

The `is` operator checks for identity, not equality. To check for an empty
list, one should use either:

    if roles == []:

Or just take advantage of the fact that an empty list is `False` when used
in a boolean expression, and write:

    if not roles:

This commit takes the second option.
@larsks larsks requested a review from tzumainn March 25, 2025 12:39
@tzumainn tzumainn merged commit 3a3cda5 into CCI-MOC:master Mar 25, 2025
4 checks passed
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