| Tor Norbye | 70ae6f2 | 2014-02-06 14:02:54 -0800 | [diff] [blame] | 1 | from spam import eggs |
| 2 | |
| 3 | for eggs in (1, 12): |
| 4 | eggs = 12 |
| 5 | |
| 6 | for a in (1, 12): |
| 7 | for b in (2, 24): |
| 8 | for (c, d) in {"C": "D"}.items(): |
| 9 | (e, f) = (a, d) |
| 10 | |
| 11 | i = 12 |
| 12 | print(i) |
| 13 | (z, x) = (i, 12) |
| 14 | print(z) |
| 15 | |
| 16 | for root in settings.STATICFILES_DIRS: |
| 17 | if isinstance(root, (list, tuple)): |
| 18 | prefix, root = root |
| 19 | |
| 20 | |
| 21 | for field, model in self.model._meta.get_concrete_fields_with_model(): |
| 22 | if model is None: |
| 23 | model = self.model |
| 24 | |
| 25 | with open('a', 'w') as a, open('b', 'w') as b: |
| 26 | do_something() |
| 27 | |
| 28 | |
| 29 | for f in [1,2,3]: |
| 30 | f = f + 1 |
| 31 | |
| 32 | for f in [1,2,3]: |
| 33 | f = spam(f) |
| 34 | |
| 35 | for f in [1,2,3]: |
| 36 | f = eggs(lambda x: x + f) |
| 37 | |
| 38 | q = [] |
| 39 | for q[0] in [1,2,3]: |
| 40 | q[0] = eggs(q) |
| 41 | |
| 42 | q = [] |
| 43 | for q[0] in [1,2,3]: |
| 44 | q[0] = eggs(q) |
| 45 | |
| 46 | for f in [1,2,3]: |
| 47 | f = eggs(lambda x: x, f) |
| 48 | |
| 49 | for a in [1,2]: |
| 50 | pass |
| 51 | |
| 52 | for a in [1,2]: |
| 53 | pass |
| 54 | |
| 55 | b = 12 |
| 56 | for b in [1,2]: |
| 57 | pass |
| 58 | |
| 59 | for item in range(5): |
| 60 | want_to_import = False |
| 61 | print want_to_import |
| 62 | want_to_import = 2 #No error should be here |
| 63 | if True: |
| 64 | pass |
| 65 | |
| 66 | for ((a, b), (c, d)) in {(1, 2): (3, 4)}.items(): |
| 67 | print b |
| 68 | |
| 69 | x = [1] |
| 70 | for x[0] in range(1,2): |
| 71 | print i |
| 72 | |
| 73 | for x[i] in range(1,2): |
| 74 | print i |
| 75 | |
| 76 | x = [[1]] |
| 77 | for x[0][0] in range(1,2): |
| 78 | x[0][1] = 1 |
| 79 | |
| 80 | class Foo(object): |
| 81 | def __init__(self): |
| 82 | super(Foo, self).__init__() |
| 83 | self.data = "ddd" |
| 84 | |
| 85 | def foo(self): |
| 86 | data, self.data = self.data |
| 87 | for data in [1,2,3]: |
| 88 | for self.data in [1,2,3]: |
| 89 | pass |
| Tor Norbye | a3e39ab | 2014-04-10 10:54:17 -0700 | [diff] [blame^] | 90 | |
| 91 | def contains_even_number(l): |
| 92 | """ |
| 93 | See: PY-12367 |
| 94 | """ |
| 95 | for elt in range(10): |
| 96 | print elt |
| 97 | else: |
| 98 | for elt in range(10): |
| 99 | pass |