Skip to content

Commit 9002974

Browse files
committed
Implement __bytes__ for the Multiaddr class
As per #48 (comment)
1 parent 767e7e5 commit 9002974

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

multiaddr/multiaddr.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ def to_bytes(self):
152152
"""Returns the byte array representation of this Multiaddr."""
153153
return self._bytes
154154

155+
__bytes__ = to_bytes
156+
155157
def protocols(self):
156158
"""Returns a list of Protocols this Multiaddr includes."""
157159
return MultiAddrKeys(self)

0 commit comments

Comments
 (0)