From 210d407bf90e4d4115f8391f3ac6b029affc13aa Mon Sep 17 00:00:00 2001 From: Stefan Harmuth Date: Sun, 7 Aug 2022 19:34:37 +0200 Subject: [PATCH] remove class variables (should be instance variables) --- tools/coordinate.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/coordinate.py b/tools/coordinate.py index 02f59bc..3609eff 100644 --- a/tools/coordinate.py +++ b/tools/coordinate.py @@ -195,10 +195,6 @@ class Coordinate: class Shape: - top_left: Coordinate - bottom_right: Coordinate - mode_3d: bool - def __init__(self, top_left: Coordinate, bottom_right: Coordinate): """ in 2D mode: top_left is the upper left corner and bottom_right the lower right @@ -211,7 +207,7 @@ class Shape: self.bottom_right = bottom_right self.mode_3d = top_left.z is not None and bottom_right.z is not None - def size(self): + def __len__(self): if not self.mode_3d: return (self.bottom_right.x - self.top_left.x + 1) * (self.bottom_right.y - self.top_left.y + 1) else: