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.
This commit is contained in:
@@ -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()]
|
||||
|
||||
Reference in New Issue
Block a user