Skip to content

Commit

Permalink
[update] avoid showing the private attributes to the in __repr__
Browse files Browse the repository at this point in the history
  • Loading branch information
Animenosekai committed Mar 2, 2023
1 parent b311690 commit 88032f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion translatepy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def __repr__(self, attrs: typing.Optional[typing.List[str]] = None) -> str:
params=", ".join("{key}={val}".format(key=attr,
val=repr(getattr(self, attr)))
for attr in (attrs or dir(self))
if not str(attr).startswith("__") and not callable(getattr(self, attr)) and attr != "raw")
if not str(attr).startswith("_") and not callable(getattr(self, attr)) and attr != "raw")
)

def __pretty__(self, cli: bool = False) -> str:
Expand Down

0 comments on commit 88032f5

Please sign in to comment.