tests/int.py | raw changeset files shortlog |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/int.py Sun Jun 27 22:12:23 2021 +0200 1.3 @@ -0,0 +1,13 @@ 1.4 +i = int(123) 1.5 +j = 123 1.6 +print i, j, i == j # 123 123 True 1.7 +k = 456 1.8 +print i, k, i == k # 123 456 False 1.9 +h = int(789) 1.10 +print i, h, i == h # 123 789 False 1.11 +print j, h, j == h # 123 789 False 1.12 + 1.13 +try: 1.14 + a = int("a") # should raise an exception 1.15 +except ValueError, exc: 1.16 + print 'int("a") failed:', exc.value