Skip to content

Conversation

@denniszollo
Copy link
Contributor

Copy link
Contributor

@benjaminaltieri benjaminaltieri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small suggestion otherwise LGTM

except Exception as exc:
warnings.warn("SBP dispatch error: %s" % (exc,))
return msg
if (len(self._sender_id_filter) == 0 or sender in self._sender_id_filter):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (len(self._sender_id_filter) == 0 or sender in self._sender_id_filter):
if (not self._sender_id_filter or sender in self._sender_id_filter):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could make that change; and agree it is a little clearer.

To do I would have to change the semantics of passing an empty list if not filter to passing None if no filter, and also change the default value to sender_id_filter=None for the keyword arg.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decided to rename the arg to include list and think that showing an empty list helps people know what to do should they choose to add a filter.

@denniszollo denniszollo merged commit f4f92e7 into master Jun 8, 2020
@denniszollo denniszollo deleted the dzollo/python_sender_id_whitelist branch June 8, 2020 20:53
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.

3 participants