diff --git a/src/fix.py b/src/fix.py index e0662d1a0..84f919e4c 100644 --- a/src/fix.py +++ b/src/fix.py @@ -74,6 +74,7 @@ def reversed(L): def window(L, size): """Returns a sliding 'window' through the list L of size size.""" + assert not isinstance(L, int), 'Argument order swapped: window(L, size)' if size < 1: raise ValueError, 'size <= 0 disallowed.' for i in xrange(len(L) - (size-1)): diff --git a/src/utils.py b/src/utils.py index 95d57f048..7d3c22809 100755 --- a/src/utils.py +++ b/src/utils.py @@ -453,7 +453,9 @@ def mktemp(suffix=''): return sha.sha(s + str(time.time())).hexdigest() + suffix def itersplit(isSeparator, iterable, maxsplit=-1, yieldEmpty=False): - """Splits an iterator based on a predicate isSeparator.""" + """itersplit(isSeparator, iterable, maxsplit=-1, yieldEmpty=False) + + Splits an iterator based on a predicate isSeparator.""" acc = [] for element in iterable: if maxsplit == 0 or not isSeparator(element):