Mercurial > hg > config
comparison python/example/classes.py @ 626:89a72399286b
adding file demonstrating classes
| author | Jeff Hammel <k0scist@gmail.com> |
|---|---|
| date | Mon, 17 Feb 2014 17:33:23 -0800 |
| parents | |
| children | 870af8d51552 |
comparison
equal
deleted
inserted
replaced
| 625:e92bd004b906 | 626:89a72399286b |
|---|---|
| 1 #!/usr/bin/env python | |
| 2 | |
| 3 """ | |
| 4 illustrate how classes work | |
| 5 """ | |
| 6 | |
| 7 class A: | |
| 8 pass | |
| 9 | |
| 10 tests = ["issubclass(A, A)"] | |
| 11 | |
| 12 if __name__ == '__main__': | |
| 13 for test in tests: | |
| 14 print ("? {}".format(test)) | |
| 15 print (eval(test)) |
