google-auth-library-python-oauthlib icon indicating copy to clipboard operation
google-auth-library-python-oauthlib copied to clipboard

Scopes are incorrectly documented as Sequence[str] type in flow.py

Open Fruglemonkey opened this issue 5 years ago • 0 comments

In flow.py, scopes are incorrectly documented as Sequence[str] in the classmethod documentation.

As far as I can tell, following the code path back up to oauthlib, scopes ends up being passed to the scope_to_list helper function which can actually take scopes in the format of list, tuple, set, str.

Importantly, set is not considered a sequence, but is useful in the context of scopes - you may have multiple tasks wishing to add to a set of scopes, in which case using set avoids unnecessary duplicates.

Suggestion: Change to Union[list[str], tuple[str], set[str], str] or Union[list[str], tuple[str], set[str]] instead.

Fruglemonkey avatar Aug 13 '20 09:08 Fruglemonkey