micropython

tests/listcomp.py

523:43f315a8e0f0
2012-06-05 Paul Boddie Added warning annotations where no attribute access targets are found from usage observations.
     1 #!/usr/bin/env python     2      3 class C:     4     def __init__(self, x):     5         self.x = x     6      7 a = [C(1), C(2), C(3)]     8 b = [x.x for x in a]     9 c = [x.x for x in a if x.x > 1]    10     11 result1_1 = b[0]    12 result1_2 = b[1]    13 result1_3 = b[2]    14 result2_2 = c[0]    15 result2_3 = c[1]    16     17 # vim: tabstop=4 expandtab shiftwidth=4