comparison python/example/classes.py @ 627:870af8d51552

STUB: python/example/classes.py
author Jeff Hammel <k0scist@gmail.com>
date Tue, 18 Feb 2014 20:09:42 -0800
parents 89a72399286b
children
comparison
equal deleted inserted replaced
626:89a72399286b 627:870af8d51552
5 """ 5 """
6 6
7 class A: 7 class A:
8 pass 8 pass
9 9
10 tests = ["issubclass(A, A)"] 10 tests = ["issubclass(A(), A)",
11 "issubclass(A, A)"]
11 12
12 if __name__ == '__main__': 13 if __name__ == '__main__':
13 for test in tests: 14 for test in tests:
14 print ("? {}".format(test)) 15 print ("? {}".format(test))
15 print (eval(test)) 16 try:
17 print (eval(test))
18 except Exception as e:
19 print ('{}'.format(repr(e)))