From 4693cf74b2041c7ff73a4c0b5dfe4015d1b5aff3 Mon Sep 17 00:00:00 2001 From: Zev Averbach Date: Wed, 2 Nov 2022 15:14:51 +0100 Subject: [PATCH] use variable name instead of underscore in list comprehension By convention, in Python we use underscores for "throwaway" variables, for example when unpacking a tuple only a few of whose members we're interested in. --- pscanner/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pscanner/__init__.py b/pscanner/__init__.py index 1f502c1..20481f4 100644 --- a/pscanner/__init__.py +++ b/pscanner/__init__.py @@ -48,4 +48,4 @@ def hosts_in_subnet(network: str) -> List[str]: if not is_subnet(network): print(f"{network} is not a network") - return [str(_) for _ in ipaddress.ip_network(network).hosts()] + return [str(host) for host in ipaddress.ip_network(network).hosts()]