Skip to content

Commit bea2deb

Browse files
Use idiomatic checks
1 parent 4779b41 commit bea2deb

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

freeride/affine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def plot(self, ax=None, textbook_style=True, max_q=None, label=True, **kwargs):
288288
>>> demand_curve = AffineElement(10.0, -2.0)
289289
>>> demand_curve.plot()
290290
"""
291-
if ax == None:
291+
if ax is None:
292292
ax = plt.gca()
293293

294294
# core plot
@@ -319,7 +319,7 @@ def plot(self, ax=None, textbook_style=True, max_q=None, label=True, **kwargs):
319319
if textbook_style:
320320
textbook_axes(ax)
321321

322-
if label == True:
322+
if label:
323323

324324
# Label Curves
325325
# if type(self).__name__ == 'Demand':

freeride/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(self, *coef, symbols=None, domain=None):
5757
"""
5858
self.set_symbols(symbols)
5959
self.is_undefined = coef == ([],) # helpful in sum functions
60-
if self.is_undefined == False:
60+
if not self.is_undefined:
6161
coef = np.squeeze(np.array(coef, ndmin=1))
6262
super().__init__(coef, domain=None, symbol=self._symbol)
6363
else:

freeride/quadratic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def plot(self, ax=None, textbook_style=True, max_q=100, label=True, **kwargs):
8787
if textbook_style:
8888
textbook_axes(ax)
8989

90-
if label == True:
90+
if label:
9191
# ax.set_ylabel("Price")
9292
ax.set_xlabel("Quantity")
9393

0 commit comments

Comments
 (0)