# HG changeset patch # User Paul Boddie # Date 1481670021 -3600 # Node ID 10fffa3651d9c4d7eb842478c5d3477ce8423f5c # Parent 18c564471d4a7df9674ac32ea5eba8aba5e0aaad Made use of __len__ methods instead of the len built-in function. diff -r 18c564471d4a -r 10fffa3651d9 lib/__builtins__/sequence.py --- a/lib/__builtins__/sequence.py Tue Dec 13 23:29:54 2016 +0100 +++ b/lib/__builtins__/sequence.py Wed Dec 14 00:00:21 2016 +0100 @@ -32,7 +32,7 @@ bounds. """ - if index < 0 or index >= len(self): + if index < 0 or index >= self.__len__(): raise IndexError(index) def _check_end_index(self, index): @@ -42,7 +42,7 @@ bounds. """ - if index < -1 or index > len(self): + if index < -1 or index > self.__len__(): raise IndexError(index) def __getitem__(self, index): @@ -202,7 +202,7 @@ "Return the index of 'value' or raise ValueError." i = 0 - l = len(self) + l = self.__len__() while i < l: if self[i] == value: return i @@ -217,7 +217,7 @@ # Sequences must have equal lengths to be equal. n = self.__len__() - if len(other) != n: + if other.__len__() != n: return False i = 0