File tree Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -375,11 +375,8 @@ def second(seq):
375375 'B'
376376 """
377377 seq = iter (seq )
378- try :
379- next (seq )
380- return next (seq )
381- except StopIteration :
382- raise
378+ next (seq )
379+ return next (seq )
383380
384381
385382def nth (n , seq ):
Original file line number Diff line number Diff line change 1717from toolz .compatibility import range , filter
1818from operator import add , mul
1919
20- import pytest
21-
2220
2321# is comparison will fail between this and no_default
2422no_default2 = loads (dumps ('__no__default__' ))
@@ -145,12 +143,6 @@ def test_second():
145143 assert second ('ABCDE' ) == 'B'
146144 assert second ((3 , 2 , 1 )) == 2
147145 assert isinstance (second ({0 : 'zero' , 1 : 'one' }), int )
148- assert second (x for x in range (2 )) == 1
149-
150- # Python 3.7, StopIteration should be raised if iterable too short
151- with pytest .raises (StopIteration ):
152- second ([])
153- second ([0 ])
154146
155147
156148def test_last ():
You can’t perform that action at this time.
0 commit comments