mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-08 22:06:10 +02:00
packet lib to string: add __str__ to base
Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka@nttcom.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
87cb024392
commit
e0d82b9d37
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user