We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a545ff commit bd9d2c3Copy full SHA for bd9d2c3
python-sequences/shape_abc.py
@@ -10,7 +10,7 @@ def __init__(self, points):
10
raise ValueError(
11
f"Shape must have at least {self.MIN_POINTS} points"
12
)
13
- if points and self.points[0] != self.points[-1]:
+ if self.points[0] != self.points[-1]:
14
self.points.append(self.points[0])
15
16
def __repr__(self):
@@ -20,9 +20,7 @@ def __getitem__(self, index):
20
return self.points[index]
21
22
def __len__(self):
23
- if self.points:
24
- return len(self.points) - 1
25
- return 0
+ return len(self.points) - 1
26
27
def __iter__(self):
28
return iter(self.points)
0 commit comments