Skip to content

Commit

Permalink
Merge pull request #1072 from spyoungtech/feat/restobject-dir
Browse files Browse the repository at this point in the history
feat(types): add __dir__ to RESTObject to expose attributes
  • Loading branch information
max-wittig committed Apr 14, 2020
2 parents efc6182 + cad134c commit c7c431a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gitlab/base.py
Expand Up @@ -111,6 +111,9 @@ def __ne__(self, other):
return self.get_id() != other.get_id()
return super(RESTObject, self) != other

def __dir__(self):
return super(RESTObject, self).__dir__() + list(self.attributes)

def __hash__(self):
if not self.get_id():
return super(RESTObject, self).__hash__()
Expand Down

0 comments on commit c7c431a

Please sign in to comment.