4 ms·
You could also group related conditions, so that nested if's don't bloat the locals so much: speedIsSlow = dict(downstreamSlow = downstreamSpeed < 200,
by iso8859-1 13y ago
You could also group related conditions, so that nested if's don't bloat the locals so much:
speedIsSlow = dict(downstreamSlow = downstreamSpeed < 200,
upstreamSlow = upstreamSpeed < 100)
if any(speedIsSlow.values()):
connectionIsDead = getPingTime() > 100
if connectionIsDead:
print("It's dead, Jim")