Skip to content

list.remove -> list.pop #289

Open
Open

Description

@yakra

Places where we test membership in a list, and then remove that value from the list, can be improved thusly:

try:
    MyIndex = MyList.index(SearchValue)
except ValueError:
    # whatever we do when SearchValue is not in list
    pass # (or just do this)
else:
    # whatever we do when SearchValue is in list
    MyList.pop(MyIndex)

Search siteupdate.py for .remove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions