handle more iterable types for messaging tokens - #977
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request relaxes type checks in check_string_list and check_number_list from list to Iterable (excluding str and dict) to support other iterable types like tuples and sets, with corresponding test updates. The reviewer noted that using Iterable allows generators or iterators, which can be exhausted during validation and will raise a TypeError when len() is called. The reviewer suggested using Collection instead of Iterable to ensure the input is sized and can be safely iterated multiple times.
b65857f to
410ccb1
Compare
The messaging tokens could only be a python
listThis PR allows to pass tuples, sets, or event django querysets.