From 4a21763b005e18762344c412a7599c2939d33772 Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Wed, 9 Oct 2024 13:41:29 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Yun Zheng Hu --- flow/record/fieldtypes/net/ip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flow/record/fieldtypes/net/ip.py b/flow/record/fieldtypes/net/ip.py index 3a661e1..73a9371 100644 --- a/flow/record/fieldtypes/net/ip.py +++ b/flow/record/fieldtypes/net/ip.py @@ -24,7 +24,7 @@ class ipaddress(FieldType): def __init__(self, addr: str | int | bytes): self.val = ip_address(addr) - def __eq__(self, b: str | int | bytes) -> bool: + def __eq__(self, b: str | int | bytes | _IPAddress) -> bool: try: return self.val == ip_address(b) except ValueError: @@ -59,7 +59,7 @@ class ipnetwork(FieldType): def __init__(self, addr: str | int | bytes): self.val = ip_network(addr) - def __eq__(self, b: str | int | bytes) -> bool: + def __eq__(self, b: str | int | bytes | _IPNetwork) -> bool: try: return self.val == ip_network(b) except ValueError: