Add trailing underscore to filter_ and use {} as the default dict

This commit is contained in:
Sebastien Besson
2015-08-18 20:43:27 +01:00
parent 31f4b1bd62
commit 763491310a
+9 -7
View File
@@ -469,20 +469,22 @@ class Organization(github.GithubObject.CompletableGithubObject):
url_parameters
)
def get_members(self, filter=github.GithubObject.NotSet,
def get_members(self, filter_=github.GithubObject.NotSet,
role=github.GithubObject.NotSet):
"""
:calls: `GET /orgs/:org/members <http://developer.github.com/v3/orgs/members>`_
:param filter: string
:param filter_: string
:param role: string
:rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.NamedUser.NamedUser`
"""
assert filter is github.GithubObject.NotSet or isinstance(filter, (str, unicode)), filter
assert role is github.GithubObject.NotSet or isinstance(role, (str, unicode)), role
assert (filter_ is github.GithubObject.NotSet or
isinstance(filter_, (str, unicode))), filter_
assert (role is github.GithubObject.NotSet or
isinstance(role, (str, unicode))), role
url_parameters = dict()
if filter is not github.GithubObject.NotSet:
url_parameters["filter"] = filter
url_parameters = {}
if filter_ is not github.GithubObject.NotSet:
url_parameters["filter"] = filter_
if role is not github.GithubObject.NotSet:
url_parameters["role"] = role
return github.PaginatedList.PaginatedList(