Lichen

tests/for.py

1027:dd0745ab8b8a
5 months ago Paul Boddie Reordered GCC arguments to prevent linking failures. Someone decided to change the GCC invocation or linking semantics at some point, meaning that libraries specified "too early" in the argument list no longer provide the symbols required by the program objects, whereas specifying them at the end of the argument list allows those symbols to be found and obtained.
     1 l = [1, 2, 3]     2      3 # Test else clause.     4      5 for i in l:     6     print i             # 1     7                         # 2     8                         # 3     9 else:    10     print 4             # 4    11     12 # Test break versus else clause.    13     14 for i in l:    15     print i             # 1    16                         # 2    17     if i == 2:    18         break    19 else:    20     print 3    21     22 # Test StopIteration in loop.    23     24 try:    25     for i in l:    26         print i         # 1    27                         # 2    28         if i == 2:    29             raise StopIteration    30     else:    31         print 3    32     33 except StopIteration:    34     print "stopped"     # stopped