Skip to content

Commit

Permalink
Nicer formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
coldfix committed Aug 17, 2018
1 parent d6d90ee commit 033ab41
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nc_dnsapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ def __init__(self, hostname, type, destination, **kwargs):
raise TypeError("Invalid record type: {}".format(self.type))

def __str__(self):
return str(self.__dict__)
return '{}({})'.format(self.__class__.__name__, ', '.join(
'{}={!r}'.format(k, v)
for k, v in self.__dict__.items()
if v is not None
))

__repr__ = __str__

Expand Down

0 comments on commit 033ab41

Please sign in to comment.