2013-10-24 | Paul Boddie | raw annotate files changeset graph | Added _attr annotations to AssName nodes, indicating attributes providing names. | syspython-as-target |
1 #!/usr/bin/env python 2 3 class A: 4 pass 5 6 class B(A): 7 pass 8 9 class C: 10 pass 11 12 def f(x): 13 return x.__class__ 14 15 a = f(A) 16 b = f(B) 17 c = f(C) 18 19 result_1 = a is type and 1 or 0 20 result_2 = b is type and 2 or 0 21 result_3 = c is type and 3 or 0 22 23 # vim: tabstop=4 expandtab shiftwidth=4