2021-06-27 | Paul Boddie | raw annotate files changeset graph | Fixed int instantiation by special-casing the type in the translator. This also avoids allocating an instance which would never be used with the tagged value representation. |
1 i = int(123) 2 j = 123 3 print i, j, i == j # 123 123 True 4 k = 456 5 print i, k, i == k # 123 456 False 6 h = int(789) 7 print i, h, i == h # 123 789 False 8 print j, h, j == h # 123 789 False 9 10 try: 11 a = int("a") # should raise an exception 12 except ValueError, exc: 13 print 'int("a") failed:', exc.value