From c2aa3df13f11b7fd89c987ef1c5f92ca8dbf334a Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Sat, 29 Jun 2019 09:23:02 -0500 Subject: [PATCH] fix some '!= None' checks, rewrite as 'is not None' --- dice/roller.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dice/roller.py b/dice/roller.py index 58a7f21..a03c722 100644 --- a/dice/roller.py +++ b/dice/roller.py @@ -70,7 +70,7 @@ class DiceRoller(object): output = "" repeat = 1 - if trials != None: + if trials is not None: repeat = trials for i in range(repeat): mode = 1 @@ -86,8 +86,8 @@ class DiceRoller(object): # m[0] = (keep, num dice) # m[1] = num faces on the die if type(m) == tuple: - if m[0] != None: - if m[0][0] != None: + if m[0] is not None: + if m[0][0] is not None: keep = m[0][0] dice = m[0][1] size = m[1] @@ -113,14 +113,14 @@ class DiceRoller(object): curr_str += str(m) total += mode * res if repeat == 1: - if comment != None: + if comment is not None: output = "%d %s (%s)" % (total, comment.strip(), curr_str) else: output = "%d (%s)" % (total, curr_str) else: output += "%d (%s)" % (total, curr_str) if i == repeat - 1: - if comment != None: + if comment is not None: output += " (%s)" % (comment.strip()) return output