Skip to content

Commit bd9d2c3

Browse files
authored
final QA (#527)
1 parent 1a545ff commit bd9d2c3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

python-sequences/shape_abc.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def __init__(self, points):
1010
raise ValueError(
1111
f"Shape must have at least {self.MIN_POINTS} points"
1212
)
13-
if points and self.points[0] != self.points[-1]:
13+
if self.points[0] != self.points[-1]:
1414
self.points.append(self.points[0])
1515

1616
def __repr__(self):
@@ -20,9 +20,7 @@ def __getitem__(self, index):
2020
return self.points[index]
2121

2222
def __len__(self):
23-
if self.points:
24-
return len(self.points) - 1
25-
return 0
23+
return len(self.points) - 1
2624

2725
def __iter__(self):
2826
return iter(self.points)

0 commit comments

Comments
 (0)