@@ -195,7 +195,7 @@ cdef bint biseq_init_list(biseq_t R, list data, size_t bound) except -1:
195195 sig_check()
196196 item_c = item
197197 if item_c > bound:
198- raise OverflowError (" list item {!r} larger than {}" .format(item, bound) )
198+ raise OverflowError (" list item {!r} larger than {}" .format(item, bound))
199199 biseq_inititem(R, index, item_c)
200200 index += 1
201201
@@ -389,7 +389,8 @@ cdef mp_size_t biseq_contains(biseq_t S1, biseq_t S2, mp_size_t start) except -2
389389 sig_on()
390390 for index from start <= index <= S1.length- S2.length:
391391 if mpn_equal_bits_shifted(S2.data.bits, S1.data.bits,
392- S2.length* S2.itembitsize, index* S2.itembitsize):
392+ S2.length * S2.itembitsize,
393+ index * S2.itembitsize):
393394 sig_off()
394395 return index
395396 sig_off()
@@ -424,7 +425,8 @@ cdef mp_size_t biseq_startswith_tail(biseq_t S1, biseq_t S2, mp_size_t start) ex
424425 sig_on()
425426 for index from start <= index < S2.length:
426427 if mpn_equal_bits_shifted(S1.data.bits, S2.data.bits,
427- (S2.length - index)* S2.itembitsize, index* S2.itembitsize):
428+ (S2.length - index) * S2.itembitsize,
429+ index * S2.itembitsize):
428430 sig_off()
429431 return index
430432 sig_off()
@@ -1381,35 +1383,35 @@ def _biseq_stresstest():
13811383 cdef list L = [BoundedIntegerSequence(6 , [randint(0 , 5 ) for z in range (randint(4 , 10 ))]) for y in range (100 )]
13821384 cdef BoundedIntegerSequence S, T
13831385 while True :
1384- branch = randint(0 ,4 )
1386+ branch = randint(0 , 4 )
13851387 if branch == 0 :
1386- L[randint(0 ,99 )] = L[randint(0 ,99 )]+ L[randint(0 ,99 )]
1388+ L[randint(0 , 99 )] = L[randint(0 , 99 )] + L[randint(0 , 99 )]
13871389 elif branch == 1 :
1388- x = randint(0 ,99 )
1390+ x = randint(0 , 99 )
13891391 if len (L[x]):
1390- y = randint(0 ,len (L[x])- 1 )
1391- z = randint(y,len (L[x])- 1 )
1392- L[randint(0 ,99 )] = L[x][y:z]
1392+ y = randint(0 , len (L[x]) - 1 )
1393+ z = randint(y, len (L[x]) - 1 )
1394+ L[randint(0 , 99 )] = L[x][y:z]
13931395 else :
1394- L[x] = BoundedIntegerSequence(6 , [randint(0 ,5 ) for z in range (randint(4 ,10 ))])
1396+ L[x] = BoundedIntegerSequence(6 , [randint(0 , 5 ) for z in range (randint(4 , 10 ))])
13951397 elif branch == 2 :
1396- t = list (L[randint(0 ,99 )])
1397- t = repr (L[randint(0 ,99 )])
1398- t = L[randint(0 ,99 )].list()
1398+ t = list (L[randint(0 , 99 )])
1399+ t = repr (L[randint(0 , 99 )])
1400+ t = L[randint(0 , 99 )].list()
13991401 elif branch == 3 :
1400- x = randint(0 ,99 )
1402+ x = randint(0 , 99 )
14011403 if len (L[x]):
1402- y = randint(0 ,len (L[x])- 1 )
1404+ y = randint(0 , len (L[x])- 1 )
14031405 t = L[x][y]
14041406 try :
14051407 t = L[x].index(t)
14061408 except ValueError :
1407- raise ValueError (" {} should be in {} (bound {}) at position {}" .format(t,L[x],L[x].bound(),y))
1409+ raise ValueError (" {} should be in {} (bound {}) at position {}" .format(t, L[x], L[x].bound(), y))
14081410 else :
1409- L[x] = BoundedIntegerSequence(6 , [randint(0 ,5 ) for z in range (randint(4 ,10 ))])
1411+ L[x] = BoundedIntegerSequence(6 , [randint(0 , 5 ) for z in range (randint(4 , 10 ))])
14101412 elif branch == 4 :
1411- S = L[randint(0 ,99 )]
1412- T = L[randint(0 ,99 )]
1413- biseq_startswith(S.data,T.data)
1413+ S = L[randint(0 , 99 )]
1414+ T = L[randint(0 , 99 )]
1415+ biseq_startswith(S.data, T.data)
14141416 biseq_contains(S.data, T.data, 0 )
14151417 biseq_startswith_tail(S.data, T.data, 0 )
0 commit comments