Fix comparison with None and equality operator

This commit is contained in:
Rotzbua 2022-12-28 18:14:58 +01:00 committed by Florian Festi
parent 4ffad120b5
commit 1d6efb5371
4 changed files with 5 additions and 5 deletions

View File

@ -706,7 +706,7 @@ class Boxes:
Flush canvas to disk and convert output to requested format if needed.
Call after .render()"""
if self.ctx == None:
if self.ctx is None:
return
self.ctx.stroke()

View File

@ -87,7 +87,7 @@ class Atreus21(Boxes, Keyboard):
@restore
def half(self, hole_cb=None, reverse=False):
if hole_cb == None:
if hole_cb is None:
hole_cb = self.key
self.moveTo(self.half_btn, self.half_btn)
self.apply_callback_on_columns(

View File

@ -449,8 +449,8 @@ class SlotDescription:
):
self.depth = depth
self.width = width
self.start_radius = radius if start_radius == None else start_radius
self.end_radius = radius if end_radius == None else end_radius
self.start_radius = radius if start_radius is None else start_radius
self.end_radius = radius if end_radius is None else end_radius
self.angle = angle
def __repr__(self):

View File

@ -165,7 +165,7 @@ class Keyboard:
grid_hole(3, -4, led_hole_size)
def apply_callback_on_columns(self, cb, columns_definition, spacing=None, reverse=False):
if spacing == None:
if spacing is None:
spacing = self.STANDARD_KEY_SPACING
if reverse:
columns_definition = list(reversed(columns_definition))