2016-11-24 | Paul Boddie | raw annotate files changeset graph | Added issubclass and improved isinstance, also introducing various native functions and operations. |
1 class C: 2 l = [2, 4, 6, 8, 10] 3 s = "test" 4 def __init__(self, x): 5 self.x = x 6 self.y = 3 7 self.z = "zebra libre" 8 9 c = C([1]) 10 x = c.x 11 f = c.x.__len__ 12 print f() # 1 13 14 y = c.l 15 g = c.l.__len__ 16 print g() # 5 17 18 yy = C.l 19 gg = C.l.__len__ 20 print gg() # 5 21 22 z = c.s 23 h = c.s.__len__ 24 print h() # 4 25 26 zz = C.s 27 hh = C.s.__len__ 28 print hh() # 4 29 30 a = c.y 31 b = c.z 32 i = c.z.__len__ 33 print i() # 11