replace everywhere: 'is [not] None' -> '(==|!=) None'

This commit is contained in:
Joeri Exelmans 2024-09-04 09:50:30 +02:00
parent 3ae35a87d0
commit ec1a9dbfca
28 changed files with 690 additions and 668 deletions

View file

@ -28,7 +28,7 @@ class PointCartesian:
Returns:
Nothing.
"""
if self.point is None:
if self.point == None:
self.point = (x, y)
else:
raise RuntimeError("A PointCartesian model can contain at most 1 point.")
@ -40,7 +40,7 @@ class PointCartesian:
Returns:
Textual representation of the point data.
"""
if self.point is None:
if self.point == None:
raise RuntimeError("No point found in model.")
else:
return f"(X = {self.point[0]}, Y = {self.point[1]})"
@ -65,7 +65,7 @@ class PointCartesian:
Returns:
Nothing.
"""
if self.point is not None:
if self.point != None:
self.point = (self.point[0] + delta_x, self.point[1] + delta_y)
else:
raise RuntimeError("No point found in model.")

View file

@ -30,7 +30,7 @@ class PointPolar:
Returns:
Nothing.
"""
if self.point is None:
if self.point == None:
self.point = (r, theta)
else:
raise RuntimeError("A PointPolar model can contain at most 1 point.")
@ -42,7 +42,7 @@ class PointPolar:
Returns:
Textual representation of the point data.
"""
if self.point is None:
if self.point == None:
raise RuntimeError("No point found in model.")
else:
return f"(r = {self.point[0]}, \u03B8 = {self.point[1]})"
@ -67,7 +67,7 @@ class PointPolar:
Returns:
Nothing.
"""
if self.point is not None:
if self.point != None:
self.point = (self.point[0] + delta_r, self.point[1] + delta_theta)
else:
raise RuntimeError("No point found in model.")