ucphhpc / docker-migrid

Containerized MiG
GNU General Public License v2.0
3 stars 7 forks source link

When checking for empty sequences #3

Closed rasmunk closed 4 years ago

rasmunk commented 5 years ago

https://github.com/rasmunk/docker-migrid/blob/9b8b092f1eb1d7117088a19fe8e0a48bd740fcd4/mig/shared/pattern.py#L70

As per https://www.python.org/dev/peps/pep-0008/

For sequences, (strings, lists, tuples), use the fact that empty sequences are false.

` Yes: if not seq: if seq:

No: if len(seq): if not len(seq):`

You can improve both L70 and L57 with:

`if not self.trigger_paths:

....

`

rasmunk commented 4 years ago

As per the refactor this is no longer an issue