Skip to content
Snippets Groups Projects
Commit 2fbc9ba1 authored by Guillaume Valadon's avatar Guillaume Valadon Committed by GitHub
Browse files

Merge pull request #805 from p-l-/flags-hashable

Make FlagValue objects hashable
parents 1944f788 066b1d5d
No related branches found
No related tags found
No related merge requests found
......@@ -1039,6 +1039,8 @@ class FlagValue(object):
self.multi = isinstance(names, list)
self.names = names
self.value = self._fixvalue(value)
def __hash__(self):
return hash(self.value)
def __int__(self):
return self.value
def __eq__(self, other):
......
......@@ -8185,6 +8185,8 @@ assert pkt.flags.DF
assert pkt.flags.evil
assert repr(pkt.flags) == '<Flag 6 (DF+evil)>'
assert len({IP().flags, IP().flags}) == 1
= TCP flags
~ TCP
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment