Skip to content
Snippets Groups Projects
Commit 5d09b9de authored by Tim Jaacks's avatar Tim Jaacks
Browse files

Refactoring: simplify length comparisons

Something we often do is check whether a list or sequence has elements
before we try and do something with it.

A Pythonic way of doing this is just to use the fact that Python lists
and sequences evaluate to True if they have elements, and False
otherwise.

Doing it this way is a convention, set out in Python's PEP8 style guide.

See for reference:
https://docs.sourcery.ai/Reference/Python/Default-Rules/simplify-len-comparison/
parent d69521c9
No related branches found
No related tags found
Loading
Pipeline #72186 skipped with stage
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment