summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ryu/lib/packet/packet.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ryu/lib/packet/packet.py b/ryu/lib/packet/packet.py
index f80948a6..785a28be 100644
--- a/ryu/lib/packet/packet.py
+++ b/ryu/lib/packet/packet.py
@@ -127,3 +127,7 @@ class Packet(object):
issubclass(protocol, packet_base.PacketBase)):
return protocol in [p.__class__ for p in self.protocols]
return protocol in self.protocols
+
+ def __str__(self):
+ return ', '.join(repr(protocol) for protocol in self.protocols)
+ __repr__ = __str__ # note: str(list) uses __repr__ for elements