2012-05-29 | Paul Boddie | raw annotate files changeset graph | Fixed/updated instance attributes definition note. |
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